Skip to content

Commit

Permalink
2024.5.1:BUG FIX: facing bugs while trying to decode gzip encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
zinja-coder committed May 14, 2024
1 parent 345185a commit 85cdf7c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions BrowserBruter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import threading
import os
import json
#import gzip
import gzip
import zlib
import brotli
import zstandard
Expand Down Expand Up @@ -632,7 +632,7 @@ def replace_response_content(request, response):
except KeyError:
response_body_encoding = 'utf-8'
if response_body_encoding.lower() == 'gzip':
response_body_str = zlib.decompress(request.response.body, zlib.MAX_WBITS)
response_body_str = gzip.decompress(request.response.body)
elif response_body_encoding.lower() =='br':
response_body_str = brotli.decompress(request.response.body)
elif response_body_encoding.lower() =='deflate':
Expand Down Expand Up @@ -1063,7 +1063,7 @@ def write_http_request_response(element, this_threads_file, driver, payload, web
raw = request.response.body
encoding = request.response.headers.get('Content-Encoding', 'UTF-8')
if encoding.lower() == 'gzip':
raw = zlib.decompress(raw, zlib.MAX_WBITS | 16)
raw = gzip.decompress(raw)
elif encoding.lower() == 'br':
raw = brotli.decompress(raw)
elif encoding.lower() == 'deflate':
Expand Down

0 comments on commit 85cdf7c

Please sign in to comment.