Skip to content

requests 1.5.0

Choose a tag to compare

@Mosaad-M Mosaad-M released this 08 Oct 23:17
· 35 commits to master since this release
dcf55cd

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 -lzstd plus a library path.
    • A project set up through mojo-pkg failed to link. A fresh Mojo environment has no libbrotlidec at all.
  • Where the libraries come from:
    • zlib: the system;
    • libzstd: the Mojo environment;
    • libbrotlidec: used when installed (pixi add brotli, apt install libbrotli1 or brew install brotli).
  • Accept-Encoding lists only what this process can decode, e.g. gzip, deflate, zstd without brotli. With no decoder at all it asks for identity. 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-Encoding for 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).