Skip to content

Commit 594579b

Browse files
committed
fix for a bug regarding --cookie and --crawl
1 parent 2094c71 commit 594579b

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎doc/THANKS‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,9 @@ Zhen Zhou <zhouzhenster@gmail.com>
583583
abc abc <biedimc@gmx.net>
584584
for reporting a minor bug
585585

586+
Abuse 007 <abuse007@gmail.com>
587+
for reporting a bug
588+
586589
Alex m3zero@gmail.com
587590
for reporting a minor bug
588591

‎lib/request/basic.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ def forgeHeaders(items=None):
4444
the HTTP requests
4545
"""
4646

47+
items = items or {}
48+
49+
for _ in items.keys():
50+
if items[_] is None:
51+
del items[_]
52+
4753
headers = dict(conf.httpHeaders)
4854
headers.update(items or {})
4955

50-
for _ in headers.keys():
51-
if headers[_] is None:
52-
del headers[_]
53-
5456
if conf.cj:
5557
if HTTPHEADER.COOKIE in headers:
5658
for cookie in conf.cj:

0 commit comments

Comments
 (0)