Skip to content
Open

489 #541

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
],
"max-depth": [
1,
3
4
],
"complexity": [
1,
Expand Down
17 changes: 6 additions & 11 deletions app/steps/sendProxyRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,17 @@ function sendProxyRequest(Container) {

proxyReq.on('error', reject);

// this guy should go elsewhere, down the chain

if (options.parseReqBody) {
// We are parsing the body ourselves so we need to write the body content
// and then manually end the request.

//if (bodyContent instanceof Object) {
//throw new Error
//debugger;
//bodyContent = JSON.stringify(bodyContent);
//}
// We are parsing the body ourselves so we need to write the body content
// and then manually end the request.

if (bodyContent.length) {
var body = bodyContent;
var contentType = proxyReq.getHeader('Content-Type');
if (contentType === 'x-www-form-urlencoded' || contentType === 'application/x-www-form-urlencoded') {
// contentTypes may contain semi-colon
// example: "application/x-www-form-urlencoded; charset=UTF-8"

if (contentType && contentType.match('x-www-form-urlencoded')) {
try {
var params = JSON.parse(body);
body = Object.keys(params).map(function (k) { return k + '=' + params[k]; }).join('&');
Expand Down
Loading