Comments (4)
can you provide a patch?
from http-parser.
mmm in deflate, you shouldn't get a gzipped response which is all the point of 16+zlib.MAX_WBITS
. Maybe smth wrong in the way they handle deflate.
from http-parser.
Here's what I've changed:
diff --git a/http_parser/parser.pyx b/http_parser/parser.pyx
index 4ec9481..835842c 100644
--- a/http_parser/parser.pyx
+++ b/http_parser/parser.pyx
@@ -109,7 +109,7 @@ cdef int on_headers_complete_cb(http_parser *parser):
res.decompressobj = zlib.decompressobj(16+zlib.MAX_WBITS)
del res.headers['content-encoding']
elif encoding == 'deflate':
- res.decompressobj = zlib.decompressobj()
+ res.decompressobj = zlib.decompressobj(-zlib.MAX_WBITS)
del res.headers['content-encoding']
else:
res.decompress = False
It seems there are two kinds of deflate in real worldlink. I wonder if there is any chance to handle them both?
from http-parser.
Maybe a better fix would be to check if an exception is raised the first time we add some data and recreate the object . I will propose a patch later today.
from http-parser.
Related Issues (20)
- benchmark results: why so slow? HOT 2
- Parsing string with multiple HTTP requests HOT 1
- handle http Persistent connection HOT 1
- Multiple headers as tuple
- Error method parsed when more data append request buffer HOT 1
- http-parser support requests module? HOT 1
- HTTP Method is wrong HOT 3
- uploading image file resulting in AttributeError: '_io.BufferedRandom' object has no attribute 'size' HOT 1
- extra space on long header values
- parser.c is out of date and fails to build on python 3.7 HOT 2
- pip3 install http_parser compile error HOT 12
- New release - wheels? HOT 2
- Bodydata None HOT 1
- Importing ABC from collections module is removed in Python 3.9 HOT 1
- pypi install of http_parser fails with python 3.7 HOT 14
- Failed building wheel for http-parser | http_parser/parser.c:4:10: fatal error: Python.h: No such file or directory HOT 1
- Build fails on python3.11
- Access to Trailer fields
- Support for python 3.11
- Python 3.12 installation fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from http-parser.