Skip to content

489 #541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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