Skip to content

Commit

Permalink
Always include r.params
Browse files Browse the repository at this point in the history
  • Loading branch information
porsager committed May 20, 2024
1 parent 074428a commit 35ffeca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ function prepareString(match, sub) {

return function(r) {
const result = r.url.match(regex)
result && names && (r.params === null || (r.params = {}), names.forEach((n, i) => r.params[n] = decodeURIComponent(result[i + 2])))
result && names && names.forEach((n, i) => r.params[n] = decodeURIComponent(result[i + 2]))
return result && result[1]
}
}
Expand Down
1 change: 1 addition & 0 deletions src/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default class Request {
this.sentStatus = false
this.sentHeaders = false
this.rawQuery = req.getQuery() || ''
this.params = {}
this[$.ip] = null
this[$.res] = res
this[$.req] = req
Expand Down

0 comments on commit 35ffeca

Please sign in to comment.