mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
body may contain ascii 0, see issue #365
This commit is contained in:
@@ -22,8 +22,9 @@ local function request(fd, method, host, url, recvheader, header, content)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if content then
|
if content then
|
||||||
local data = string.format("%s %s HTTP/1.1\r\n%scontent-length:%d\r\n\r\n%s", method, url, header_content, #content, content)
|
local data = string.format("%s %s HTTP/1.1\r\n%scontent-length:%d\r\n\r\n", method, url, header_content, #content)
|
||||||
write(data)
|
write(data)
|
||||||
|
write(content)
|
||||||
else
|
else
|
||||||
local request_header = string.format("%s %s HTTP/1.1\r\n%scontent-length:0\r\n\r\n", method, url, header_content)
|
local request_header = string.format("%s %s HTTP/1.1\r\n%scontent-length:0\r\n\r\n", method, url, header_content)
|
||||||
write(request_header)
|
write(request_header)
|
||||||
|
|||||||
Reference in New Issue
Block a user