Skip to content

Commit 0cb6839

Browse files
sunnylqmchimurai
authored andcommitted
fix(pathRewrite): path can be empty string (chimurai#110)
* allow empty string as path. * disallow non-string path.
1 parent 7d1865c commit 0cb6839

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function HttpProxyMiddleware(context, opts) {
119119
if (pathRewriter) {
120120
var path = pathRewriter(req.url, req);
121121

122-
if (path) {
122+
if (typeof path === 'string') {
123123
req.url = path;
124124
} else {
125125
logger.info('[HPM] pathRewrite: No rewritten path found. (%s)', req.url);

0 commit comments

Comments
 (0)