Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f6c3b4

Browse files
committed
Minor update (not overriding user given 'Accept-Encoding' header value)
1 parent 8281fe4 commit 3f6c3b4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/request/connect.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ def getPage(**kwargs):
332332
if HTTP_HEADER.ACCEPT not in headers:
333333
headers[HTTP_HEADER.ACCEPT] = HTTP_ACCEPT_HEADER_VALUE
334334

335-
headers[HTTP_HEADER.ACCEPT_ENCODING] = HTTP_ACCEPT_ENCODING_HEADER_VALUE if kb.pageCompress else "identity"
335+
if HTTP_HEADER.ACCEPT_ENCODING not in headers:
336+
headers[HTTP_HEADER.ACCEPT_ENCODING] = HTTP_ACCEPT_ENCODING_HEADER_VALUE if kb.pageCompress else "identity"
337+
336338
headers[HTTP_HEADER.HOST] = host or getHostHeader(url)
337339

338340
if post is not None and HTTP_HEADER.CONTENT_TYPE not in headers:

0 commit comments

Comments
 (0)