Skip to content

Commit

Permalink
filter out custom content length header
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkav committed Aug 26, 2024
1 parent d8cd876 commit bff2b48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/routes/bins/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ module.exports = (client) => (req, res, next) => {
}

mock.content.size = 0;
// express is sensitive to mismatched content-length header
mock.headers = mock.headers.filter((header) => header.name.toLowerCase() !== "content-length");

validate
.response(mock)
Expand Down
2 changes: 2 additions & 0 deletions lib/routes/bins/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ module.exports = (client) => (req, res, next) => {
}

mock.content.size = 0;
// express is sensitive to mismatched content-length header
mock.headers = mock.headers.filter((header) => header.name.toLowerCase() !== "content-length");

validate
.response(mock)
Expand Down

0 comments on commit bff2b48

Please sign in to comment.