Skip to content

Commit 5c38a0b

Browse files
committed
Use specified Content-Length if provided
This change allows to test how endpoints deal with invalid POST (advertising more or less bytes than actually sent, etc).
1 parent de611a0 commit 5c38a0b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wsapi/mock.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ local function build_post(path, params, headers)
124124
req.QUERY_STRING = qs
125125
end
126126

127-
req.CONTENT_LENGTH = #body
127+
req.CONTENT_LENGTH = headers["Content-Length"] or #body
128128

129129
return {
130130
env = req,

0 commit comments

Comments
 (0)