Skip to content

Commit

Permalink
Merge branch 'main' into fix/ffi-cgo
Browse files Browse the repository at this point in the history
  • Loading branch information
Techassi authored Nov 3, 2023
2 parents b3bbe3b + 0211d0a commit 856063e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rust/stackable-cockpitd/src/handlers/ui.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use axum::{
extract::Path,
http::{header::CONTENT_TYPE, HeaderValue},
response::{AppendHeaders, Html, IntoResponse},
response::{Html, IntoResponse},
routing::get,
Router,
};
Expand All @@ -18,14 +18,14 @@ async fn ui() -> Html<&'static str> {
}
async fn asset(Path(name): Path<String>) -> impl IntoResponse {
(
AppendHeaders([(
[(
CONTENT_TYPE,
match name.split_once('.') {
match name.rsplit_once('.') {
Some((_, "js")) => HeaderValue::from_static("text/javascript"),
Some((_, "css")) => HeaderValue::from_static("text/css"),
_ => HeaderValue::from_static("application/octet-stream"),
},
)]),
)],
stackable_cockpit_web::ASSETS[&name],
)
}

0 comments on commit 856063e

Please sign in to comment.