1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-24 08:29:04 +00:00

Skip over a single 100 Continue response, if present, before parsing the

real response in http.lua. This patch is by Patrik Karlsson.
This commit is contained in:
david
2009-12-13 22:52:08 +00:00
parent 696d5cb66d
commit ee0fee26c0

View File

@@ -1083,6 +1083,13 @@ function parseResult( response, options )
if type(response) ~= "string" then return response end
local result = {status=nil,["status-line"]=nil,header={},rawheader={},body=""}
-- See RFC 2616, sections 8.2.3 and 10.1.1, for the 100 Continue status.
-- Sometimes a server will tell us to "go ahead" with a POST body before
-- sending the real response. If we got one of those, skip over it.
if response and response:match("^HTTP/%d.%d 100%s") then
response = response:match("\r?\n\r?\n(.*)$")
end
-- try and separate the head from the body
local header, body
if response and response:match( "\r?\n\r?\n" ) then