Skip to content

Commit

Permalink
Rewriting + to %20 for coercion of form encoded request body
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Sep 28, 2020
1 parent eadfaa1 commit 833b36a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function parse (req, res, next) {
req.body = {};

for (const i of args) {
req.body[i[0]] = coerce(decodeURIComponent(i[1]));
req.body[i[0]] = coerce(decodeURIComponent(i[1].replace(/\+/g, "%20")));
}
} else if (type.includes("application/json") || jsonWrap(req.body)) {
try {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenso",
"description": "Tensō is an HTTP/HTTP2 REST API framework",
"version": "15.0.12",
"version": "15.0.13",
"homepage": "https://github.com/avoidwork/tenso",
"author": "Jason Mulligan <[email protected]>",
"repository": {
Expand Down

0 comments on commit 833b36a

Please sign in to comment.