Compress middleware should not compress image/*
content types
#2981
Labels
A-web
project: actix-web
C-improvement
Category: an improvement to existing functionality
good-first-issue
easy to pick up for newcomers
Expected Behavior
Most
image/*
mime types such as png and jpeg are already pre-compressed, so when using.wrap(middleware::Compress::default())
, the expectation is that the well known images would not be compressed.Current Behavior
Currently the compression middleware only looks at the
content-encoding
of the response (which should not be set for images), and thus compresses images again.Possible Solution
Your Environment
The text was updated successfully, but these errors were encountered: