Skip to content

Commit

Permalink
fix(pathRewrite): path can be empty string (#110)
Browse files Browse the repository at this point in the history
* allow empty string as path.
* disallow non-string path.
  • Loading branch information
sunnylqm authored and chimurai committed Sep 20, 2016
1 parent 7d1865c commit 0cb6839
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function HttpProxyMiddleware(context, opts) {
if (pathRewriter) {
var path = pathRewriter(req.url, req);

if (path) {
if (typeof path === 'string') {
req.url = path;
} else {
logger.info('[HPM] pathRewrite: No rewritten path found. (%s)', req.url);
Expand Down

0 comments on commit 0cb6839

Please sign in to comment.