Skip to content

Commit

Permalink
fix: always restore req.url for each layer to avoid mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 22, 2021
1 parent 986785d commit aae5787
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ export function createHandle (stack: Stack): PHandle {
continue
}
req.url = reqUrl.substr(layer.route.length) || '/'
} else {
req.url = reqUrl
}
if (layer.match && !layer.match(req.url as string, req)) {
continue
Expand Down

0 comments on commit aae5787

Please sign in to comment.