Skip to content

Commit

Permalink
chore(ui): update response builder to fix content type header
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed May 5, 2024
1 parent 0af1e25 commit 2de3c7f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ee/tabby-webserver/src/routes/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ where
Some(content) => {
let body = Body::from(content.data);
let mime = mime_guess::from_path(&path).first_or_octet_stream();
let mut builder =
Response::builder().header(header::CACHE_CONTROL, "public, max-age=604800");
let mut builder = Response::builder().header(header::CONTENT_TYPE, mime.as_ref());
if !path.ends_with(".html") {
builder = builder.header(header::CONTENT_TYPE, mime.as_ref())
builder = builder.header(header::CACHE_CONTROL, "public, max-age=604800");
};
builder
.body(body)
Expand Down

0 comments on commit 2de3c7f

Please sign in to comment.