Repository navigation
requests 1.5.0
No linker flags needed. A program using requests now builds with mojo build app.mojo $(cat .mojo_flags) and nothing else.
Changed
- Compression libraries load at runtime: zlib (gzip, deflate), libzstd and libbrotlidec are opened when first needed instead of being linked.
- Before, every program had to add
-Xlinker -lz -lbrotlidec -lzstdplus a library path. - A project set up through mojo-pkg failed to link. A fresh Mojo environment has no libbrotlidec at all.
- Before, every program had to add
- Where the libraries come from:
- zlib: the system;
- libzstd: the Mojo environment;
- libbrotlidec: used when installed (
pixi add brotli,apt install libbrotli1orbrew install brotli).
Accept-Encodinglists only what this process can decode, e.g.gzip, deflate, zstdwithout brotli. With no decoder at all it asks foridentity. If a server sends an encoding anyway and its library is missing, the error names the library and how to install it.
Fixed
- HTTP/2 padded frames: DATA frames with the PADDED flag kept their padding in the body. google.com pads, so its gzip responses failed with
inflate returned -3, in 1.4.0 too. HEADERS frames now skip padding as well. - Pointer lifetimes: the chunked-body decoder and the response parser read through a pointer to a temporary copy that could already be freed. They now read the original directly.
Testing
- Suites: all build without linker flags on Linux and macOS: 114 + 4 client, 128 hpack, 70 h2 and more.
- New tests:
Accept-Encodingfor every combination of available libraries;- brotli missing;
- no decoders;
- the HTTP/2 padding cases.
- Live, built with no flags:
- example.com (br and gzip), google.com over HTTP/2, debian.org and github.com (gzip);
- facebook.com and instagram.com (zstd).