Compare commits

...

2 Commits

Author SHA1 Message Date
Degubi 23830acffd
Merge 89c8802baf into cede0c6dbb 2025-03-10 14:54:32 -07:00
Degubi 89c8802baf Fix svg files not being compressed 2024-10-16 17:48:23 +02:00
2 changed files with 7 additions and 1 deletions

View File

@ -21,6 +21,7 @@
- On Windows, an error is now returned from `HttpServer::bind()` (or TLS variants) when binding to a socket that's already in use.
- Update `brotli` dependency to `7`.
- Minimum supported Rust version (MSRV) is now 1.75.
- Fix Svg images not being compressed by the `Compress` middleware.
## 4.9.0

View File

@ -191,7 +191,12 @@ where
None => true,
Some(hdr) => {
match hdr.to_str().ok().and_then(|hdr| hdr.parse::<Mime>().ok()) {
Some(mime) if mime.type_().as_str() == "image" => false,
Some(mime)
if mime.type_().as_str() == "image"
&& mime.subtype().as_str() != "svg+xml" =>
{
false
}
Some(mime) if mime.type_().as_str() == "video" => false,
_ => true,
}