Skip to content

Commit

Permalink
Replace startsWith with direct property comparison (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Jul 7, 2022
1 parent 29321d5 commit 7890c87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function middie (complete) {
const result = regexp.exec(url)
if (result) {
req.url = req.url.replace(result[0], '')
if (req.url.startsWith('/') === false) {
if (req.url[0] !== '/') {
req.url = '/' + req.url
}
fn(req, res, that.done)
Expand Down

0 comments on commit 7890c87

Please sign in to comment.