File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -36,22 +36,17 @@ function sendProxyRequest(Container) {
3636
3737 proxyReq . on ( 'error' , reject ) ;
3838
39- // this guy should go elsewhere, down the chain
40-
4139 if ( options . parseReqBody ) {
42- // We are parsing the body ourselves so we need to write the body content
43- // and then manually end the request.
44-
45- //if (bodyContent instanceof Object) {
46- //throw new Error
47- //debugger;
48- //bodyContent = JSON.stringify(bodyContent);
49- //}
40+ // We are parsing the body ourselves so we need to write the body content
41+ // and then manually end the request.
5042
5143 if ( bodyContent . length ) {
5244 var body = bodyContent ;
5345 var contentType = proxyReq . getHeader ( 'Content-Type' ) ;
54- if ( contentType === 'x-www-form-urlencoded' || contentType === 'application/x-www-form-urlencoded' ) {
46+ // contentTypes may contain semi-colon
47+ // example: "application/x-www-form-urlencoded; charset=UTF-8"
48+
49+ if ( contentType && contentType . match ( 'x-www-form-urlencoded' ) ) {
5550 try {
5651 var params = JSON . parse ( body ) ;
5752 body = Object . keys ( params ) . map ( function ( k ) { return k + '=' + params [ k ] ; } ) . join ( '&' ) ;
You can’t perform that action at this time.
0 commit comments