mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
http chunked不能同时指定content-length (#2046)
Co-authored-by: tangzhaoning <sherlock@eyugame.com>
This commit is contained in:
@@ -185,7 +185,12 @@ function M.request(interface, method, host, url, recvheader, header, content)
|
||||
end
|
||||
|
||||
if content then
|
||||
local data = string.format("%s %s HTTP/1.1\r\n%sContent-length:%d\r\n\r\n", method, url, header_content, #content)
|
||||
local data
|
||||
if header["transfer-encoding"] == "chunked" then
|
||||
data = string.format("%s %s HTTP/1.1\r\n%s\r\n", method, url, header_content)
|
||||
else
|
||||
data = string.format("%s %s HTTP/1.1\r\n%sContent-length:%d\r\n\r\n", method, url, header_content, #content)
|
||||
end
|
||||
write(data)
|
||||
write(content)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user