mirror of
https://github.com/appium/appium.git
synced 2026-01-18 08:09:53 -06:00
Do not try doing stuff with body if undefined (ex: 500 status code).
This commit is contained in:
@@ -41,9 +41,11 @@ module.exports = function(appium) {
|
||||
request(url, req.route.method.toUpperCase(), req.body,
|
||||
req.headers['content-type'], function(err, response, body) {
|
||||
if (err) return next(err);
|
||||
var sbody = body ? JSON.stringify(body).slice(0, 1000) : body;
|
||||
|
||||
logger.debug("Proxied response received with status " +
|
||||
response.statusCode + ": " +
|
||||
JSON.stringify(body).slice(0, 1000));
|
||||
sbody);
|
||||
res.headers = response.headers;
|
||||
res.send(response.statusCode, body);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user