mirror of
https://github.com/fafhrd91/actix-web
synced 2025-02-17 10:13:30 +01:00
Fix svg files not being compressed
This commit is contained in:
parent
03c65d93e5
commit
89c8802baf
@ -5,6 +5,7 @@
|
|||||||
- On Windows, an error is now returned from `HttpServer::bind()` (or TLS variants) when binding to a socket that's already in use.
|
- 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`.
|
- Update `brotli` dependency to `7`.
|
||||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||||
|
- Fix Svg images not being compressed by the `Compress` middleware.
|
||||||
|
|
||||||
## 4.9.0
|
## 4.9.0
|
||||||
|
|
||||||
|
@ -191,7 +191,12 @@ where
|
|||||||
None => true,
|
None => true,
|
||||||
Some(hdr) => {
|
Some(hdr) => {
|
||||||
match hdr.to_str().ok().and_then(|hdr| hdr.parse::<Mime>().ok()) {
|
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,
|
Some(mime) if mime.type_().as_str() == "video" => false,
|
||||||
_ => true,
|
_ => true,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user