diff --git a/doc/THANKS b/doc/THANKS index ea21a8c41..56416b7ea 100644 --- a/doc/THANKS +++ b/doc/THANKS @@ -583,6 +583,9 @@ Zhen Zhou abc abc for reporting a minor bug +Abuse 007 + for reporting a bug + Alex m3zero@gmail.com for reporting a minor bug diff --git a/lib/request/basic.py b/lib/request/basic.py index 35edd0406..39478d787 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -44,13 +44,15 @@ def forgeHeaders(items=None): the HTTP requests """ + items = items or {} + + for _ in items.keys(): + if items[_] is None: + del items[_] + headers = dict(conf.httpHeaders) headers.update(items or {}) - for _ in headers.keys(): - if headers[_] is None: - del headers[_] - if conf.cj: if HTTPHEADER.COOKIE in headers: for cookie in conf.cj: