From c9d1c4d7b18de1e3c5e85091ee42235081afa4f5 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 16 Aug 2015 23:29:39 +0200 Subject: [PATCH] Fixes #1337 --- lib/core/common.py | 5 ++--- lib/core/option.py | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 83eea703f..a12bd8d35 100755 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2280,10 +2280,9 @@ def findMultipartPostBoundary(post): candidates = [] for match in re.finditer(r"(?m)^--(.+?)(--)?$", post or ""): - _ = re.search(r"\w+", match.group(1)) - _ = _.group(0) if _ else None + _ = match.group(1).strip().strip('-') - if _ is None or _ in done: + if _ in done: continue else: candidates.append((post.count(_), _)) diff --git a/lib/core/option.py b/lib/core/option.py index 5b51c4792..fb3abe86d 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -314,6 +314,7 @@ def _feedTargetsDict(reqFile, addedTargetUrls): # Headers elif re.search(r"\A\S+: ", line): key, value = line.split(": ", 1) + value = value.replace("\r", "").replace("\n", "") # Cookie and Host headers if key.upper() == HTTP_HEADER.COOKIE.upper():