aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2022-03-22 09:39:02 +0100
committerGitHub <noreply@github.com>2022-03-22 09:39:02 +0100
commitd3434c01983de3ec40e4535f856081ad138fa198 (patch)
treec7d224fba05b39146f44bcebca62036928df50a5
parente178b1e0183ba07290145be3ec718cd78ad826cc (diff)
parent2a76cb906cb955a83ed76b8e47cc76c77ce8e15f (diff)
downloadluasocket-d3434c01983de3ec40e4535f856081ad138fa198.tar.gz
luasocket-d3434c01983de3ec40e4535f856081ad138fa198.tar.bz2
luasocket-d3434c01983de3ec40e4535f856081ad138fa198.zip
Merge pull request #318 from tokenrove/transfer-encoding-chunked
-rw-r--r--src/http.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/http.lua b/src/http.lua
index e3a1742..1330355 100644
--- a/src/http.lua
+++ b/src/http.lua
@@ -283,6 +283,13 @@ local function adjustrequest(reqt)
283 nreqt.uri = reqt.uri or adjusturi(nreqt) 283 nreqt.uri = reqt.uri or adjusturi(nreqt)
284 -- adjust headers in request 284 -- adjust headers in request
285 nreqt.headers = adjustheaders(nreqt) 285 nreqt.headers = adjustheaders(nreqt)
286 if nreqt.source
287 and not nreqt.headers["content-length"]
288 and not nreqt.headers["transfer-encoding"]
289 then
290 nreqt.headers["transfer-encoding"] = "chunked"
291 end
292
286 -- ajust host and port if there is a proxy 293 -- ajust host and port if there is a proxy
287 nreqt.host, nreqt.port = adjustproxy(nreqt) 294 nreqt.host, nreqt.port = adjustproxy(nreqt)
288 return nreqt 295 return nreqt