You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [x] I have looked for existing issues (including closed) about this
Bug Report
Version
0.6.x and main branch
Platform
Linux fedora 6.2.15-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 11 15:56:33 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Crates
examples/static-file-server
Description
let svc = ServeDir::new("assets").not_found_service(ServeFile::new("assets/index.html")).precompressed_gzip().precompressed_deflate().precompressed_br();// Should reply with gzipped file if client supports itlet request = Request::builder().uri("/index.html").header("Accept-Encoding","gzip").body(Body::empty()).unwrap();let res = svc.clone().oneshot(request).await.unwrap();assert_eq!(res.headers()["content-encoding"], "gzip");assert_eq!(res.headers()["content-type"], "text/html");
got panic:
thread 'main' panicked at 'no entry found for key "content-encoding"', examples/static-file-server/src/main.rs:43:16
The text was updated successfully, but these errors were encountered:
Is there an index.html.gz in your data directory? The methods you called are for serving precompressed files that already exist on disk. For compressing on the fly, use CompressionLayer.
@jplatte
with zip file, still not work.
But compression layer works fine.
It might be a tower-http problem, not support file without extension either, maybe there's more bug.
Not .zip, .gz as created by gzip. Anyways, please open an issue or maybe a discussion on tower-http if you have trouble using it. axum isn't really relevant here.
- [x] I have looked for existing issues (including closed) about this
Bug Report
Version
0.6.x and main branch
Platform
Linux fedora 6.2.15-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 11 15:56:33 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Crates
examples/static-file-server
Description
got panic:
thread 'main' panicked at 'no entry found for key "content-encoding"', examples/static-file-server/src/main.rs:43:16
The text was updated successfully, but these errors were encountered: