koa2-nginx
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -43,3 +43,7 @@ const httpProxyMiddleware = require('http-proxy-middleware'); | ||
if (req.koaReq.body) { | ||
// https://github.com/koajs/bodyparser#raw-body | ||
if ( | ||
Object.keys(req.koaReq.body).length || | ||
(req.koaReq.body && req.koaReq.rawBody) | ||
) { | ||
const contentType = proxyReq.getHeader('Content-Type'); | ||
@@ -100,3 +104,3 @@ let bodyData; | ||
if (proxyConfig.autoProcessReqBody && proxyConfig.onProxyReq) { | ||
if (proxyConfig.autoProcessReqBody) { | ||
proxyConfig.onProxyReq = wraperProxyReqHandler(proxyConfig.onProxyReq); | ||
@@ -103,0 +107,0 @@ } |
{ | ||
"name": "koa2-nginx", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "This is an http-proxy koa proxy middleware that can be used after bodyparse", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -107,3 +107,6 @@ const expect = require('expect.js'); | ||
koaReq: { | ||
body: { a: 1 } | ||
body: { | ||
a: 1 | ||
}, | ||
rawBody: '{\n "a": 1\n}' | ||
} | ||
@@ -128,3 +131,4 @@ }; | ||
koaReq: { | ||
body: 'a=1' | ||
body: 'a=1', | ||
rawBody: 'a=1' | ||
} | ||
@@ -131,0 +135,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14633
253