Skip to content

Support for statically compressed brotli content-encoding

This MR is a brotli version of !25 (merged) and addresses #125 (closed).

A couple things:

  • If the client has br or * in their Accept-Encoding, first look for a .br file -> fallback to .gz -> fallback uncompressed.
  • Else, do not break existing logic

This is still a work in progress since I've not gotten the tests to work just yet. The current gzip tests use gzip from the standard library, which of course doesn't come with an implementation of brotli. I'm trying to use the go bindings to the original brotli library in C. There are a couple issues I'm running into: I'm using github.com/dsnet/compress/brotli

  • I've not gotten the bindings to work just yet, hence brotli testing is currently commented out Now using a pure golang implementation
  • I'm installing the brotli library from the debian repos in our testing docker containers. This doesn't work on the golang:1.8 container since that is based on debian jessie rather than debian stretch, and jessie's repos don't have the brotli library. Now running tests on alpine, which has no issues. The pure golang implementation doesn't need this.
  • I'm not able to test brotli compression using files from http://group.test.io/ files. Figured it out, thanks!

I would appreciate if someone can help me figure these out.

Edited by 🤖 GitLab Bot 🤖

Merge request reports