tomaka / rouille

Web framework in Rust
Apache License 2.0
1.09k stars 105 forks source link

When "brotli" is disabled and "gzip" is enabled, responses are not compressed #270

Open fleabitdev opened 1 year ago

fleabitdev commented 1 year ago

Version: 3.6.1

To reproduce: Enable the "gzip" feaure, disable the "brotli" feature, and serve a text/plain document using rouille::content_encoding::apply(). Access that document using a browser which accepts the encodings gzip and br.

Expected behaviour: The response should be gzip-compressed.

Observed behaviour: rouille::content_encoding::apply() prioritises brotli encoding over gzip encoding, even when the "brotli" feature is disabled. Under those circumstances, the brotli() function in that module is stubbed out, so the response is not compressed.