mirror of
https://github.com/appium/appium.git
synced 2026-05-02 16:30:57 -05:00
upgrade express so we don't get warning messages
This commit is contained in:
+4
-2
@@ -5,7 +5,7 @@ var http = require('http')
|
||||
, fs = require('fs')
|
||||
, logger = require('./logger.js').get('appium')
|
||||
, appium = require('../appium.js')
|
||||
, bodyParser = require('./middleware').parserWrap
|
||||
, parserWrap = require('./middleware').parserWrap
|
||||
, status = require('./status.js')
|
||||
, appiumVer = require('../../package.json').version
|
||||
, appiumRev = null
|
||||
@@ -87,7 +87,9 @@ var main = function(args, readyCb, doneCb) {
|
||||
if (args.log || args.webhook) {
|
||||
rest.use(express.logger({stream: winstonStream}));
|
||||
}
|
||||
rest.use(bodyParser);
|
||||
rest.use(parserWrap);
|
||||
rest.use(express.urlencoded());
|
||||
rest.use(express.json());
|
||||
rest.use(express.methodOverride());
|
||||
rest.use(rest.router);
|
||||
rest.use(catchAllHandler);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
var express = require('express')
|
||||
, _s = require('underscore.string')
|
||||
, bodyParser = express.bodyParser();
|
||||
, _s = require('underscore.string');
|
||||
|
||||
module.exports.parserWrap = function(req, res, next) {
|
||||
// wd.js sends us http POSTs with empty body which will make bodyParser fail.
|
||||
@@ -18,6 +17,6 @@ module.exports.parserWrap = function(req, res, next) {
|
||||
req.headers['content-type'] = 'application/json';
|
||||
}
|
||||
}
|
||||
bodyParser(req, res, next);
|
||||
next();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user