Skip to content

Commit

Permalink
cleanup adding of gzip to accept-encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Aug 1, 2021
1 parent bc6a2ca commit be364b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mechanize/_gzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ def __copy__(self):
def http_request(self, request):
if self.request_gzip:
existing = [
x.strip()
x.strip().lower()
for x in request.get_header('Accept-Encoding', '').split(',')
]
if sum('gzip' in x for x in existing) < 1:
if 'gzip' not in existing:
existing.append('gzip')
request.add_header("Accept-Encoding",
', '.join(filter(None, existing)))
Expand Down

0 comments on commit be364b6

Please # to comment.