We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
content-type
1 parent d0e6786 commit 0211d0aCopy full SHA for 0211d0a
rust/stackable-cockpitd/src/handlers/ui.rs
@@ -1,7 +1,7 @@
1
use axum::{
2
extract::Path,
3
http::{header::CONTENT_TYPE, HeaderValue},
4
- response::{AppendHeaders, Html, IntoResponse},
+ response::{Html, IntoResponse},
5
routing::get,
6
Router,
7
};
@@ -18,14 +18,14 @@ async fn ui() -> Html<&'static str> {
18
}
19
async fn asset(Path(name): Path<String>) -> impl IntoResponse {
20
(
21
- AppendHeaders([(
+ [(
22
CONTENT_TYPE,
23
- match name.split_once('.') {
+ match name.rsplit_once('.') {
24
Some((_, "js")) => HeaderValue::from_static("text/javascript"),
25
Some((_, "css")) => HeaderValue::from_static("text/css"),
26
_ => HeaderValue::from_static("application/octet-stream"),
27
},
28
- )]),
+ )],
29
stackable_cockpit_web::ASSETS[&name],
30
)
31
0 commit comments