Skip to content

Commit

Permalink
more restrictive http protocol regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavi Mendez committed Nov 5, 2020
1 parent 43bd5f0 commit d02966a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wfuzz/externals/reqresp/Response.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def parseResponse(self, rawheader, rawbody=None, type="curl"):
tp = TextParser()
tp.setSource("string", rawheader)

tp.readUntil(r"(HTTP\S*) ([0-9]+)")
tp.readUntil(r"(HTTP/[0-9.]+) ([0-9]+)")
while True:
while True:
try:
Expand All @@ -162,7 +162,7 @@ def parseResponse(self, rawheader, rawbody=None, type="curl"):
if self.code != "100":
break
else:
tp.readUntil(r"(HTTP\S*) ([0-9]+)")
tp.readUntil(r"(HTTP/[0-9.]+) ([0-9]+)")

self.code = int(self.code)

Expand All @@ -176,7 +176,7 @@ def parseResponse(self, rawheader, rawbody=None, type="curl"):
# curl sometimes sends two headers when using follow, 302 and the final header
# also when using proxies
tp.readLine()
if not tp.search(r"(HTTP\S*) ([0-9]+)"):
if not tp.search(r"(HTTP/[0-9.]+) ([0-9]+)"):
break
else:
self._headers = []
Expand Down

0 comments on commit d02966a

Please sign in to comment.