Skip to content
Snippets Groups Projects
Unverified Commit 4009eee8 authored by Volkor Barbarian Warrior's avatar Volkor Barbarian Warrior
Browse files

overwrite content-type to fix reloading bug

For some reason we'd get
"image "*.png" cannot be displayed because it contains errors"
Turns out this is due to multiple content-type headers
So we've enabled "overwriting" when adding the header.
parent 9de7b7c2
No related branches found
No related tags found
No related merge requests found
......@@ -131,7 +131,7 @@ pub async fn serve_file(req: &mut Request, res: &mut Response) {
res.add_header("X-Accel-Redirect", xsend, true).unwrap();
// Add the header to the response, which /may/ or /may not/ be modified by the safety check
res.add_header("Content-Type", mimetype, false).unwrap();
res.add_header("Content-Type", mimetype, true).unwrap();
// Go through all the headers and print them out, just to check for now!
tracing::debug!("response headers: {:?}", res.headers());
......@@ -148,7 +148,7 @@ pub async fn serve_file(req: &mut Request, res: &mut Response) {
file.send(&headers, res).await;
// Add the header to the response, which /may/ or /may not/ be modified by the safety check
res.add_header("Content-Type", mimetype, false).unwrap();
res.add_header("Content-Type", mimetype, true).unwrap();
// Go through all the headers and print them out, just to check for now!
tracing::debug!("response headers: {:?}", res.headers());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment