@@ -255,10 +255,13 @@ def _parseBurpLog(content):
255255 data = None
256256 cookie = None
257257 params = False
258- lines = request .split ("\n " )
258+ newline = None
259+ lines = request .split ('\n ' )
259260
260261 for line in lines :
261- if len (line ) == 0 or line == "\n " :
262+ newline = "\r \n " if line .endswith ('\r ' ) else '\n '
263+ line = line .strip ('\r ' )
264+ if len (line ) == 0 :
262265 if method == HTTPMETHOD .POST and data is None :
263266 data = ""
264267 params = True
@@ -279,7 +282,7 @@ def _parseBurpLog(content):
279282
280283 # POST parameters
281284 elif data is not None and params :
282- data += "%s%s" % (" \n " if data else "" , line )
285+ data += "%s%s" % (line , newline )
283286
284287 # GET parameters
285288 elif "?" in line and "=" in line and ": " not in line :
@@ -299,7 +302,7 @@ def _parseBurpLog(content):
299302 host = splitValue [0 ]
300303
301304 if len (splitValue ) > 1 :
302- port = filterStringValue (splitValue [1 ], ' [0-9]' )
305+ port = filterStringValue (splitValue [1 ], " [0-9]" )
303306
304307 # Avoid to add a static content length header to
305308 # conf.httpHeaders and consider the following lines as
@@ -334,7 +337,6 @@ def _parseBurpLog(content):
334337 fp = openFile (reqFile , "rb" )
335338
336339 content = fp .read ()
337- content = content .replace ("\r " , "" )
338340
339341 if conf .scope :
340342 logger .info ("using regular expression '%s' for filtering targets" % conf .scope )
0 commit comments