Skip to content
Open
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 app/steps/sendProxyRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function sendProxyRequest(Container) {
if (bodyContent.length) {
var body = bodyContent;
var contentType = proxyReq.getHeader('Content-Type');
if (contentType === 'x-www-form-urlencoded' || contentType === 'application/x-www-form-urlencoded') {
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
1 change: 1 addition & 0 deletions test/getBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('when proxy request is a GET', function () {

var testCases = [
{ name: 'form encoded', encoding: 'application/x-www-form-urlencoded' },
{ name: 'form encoded with charset', encoding: 'application/x-www-form-urlencoded; charset=UTF-8' }, // #488
{ name: 'JSON encoded', encoding: 'application/json' }
];

Expand Down