Set MIME type when pretty

This commit is contained in:
Daniel 2023-03-01 11:20:29 -05:00
parent 7ec53f3806
commit 773932dd85

View file

@ -96,7 +96,7 @@ async fn serve(
let overrides = &config.paste.highlight_override; let overrides = &config.paste.highlight_override;
values.insert("type", if overrides.contains_key(&mime_str) { overrides[&mime_str].as_str() } else { "" }); values.insert("type", if overrides.contains_key(&mime_str) { overrides[&mime_str].as_str() } else { "" });
let rendered = tmpl.fill_in(&values); let rendered = tmpl.fill_in(&values);
return Ok(HttpResponse::Ok().body(rendered.to_string())) return Ok(HttpResponse::Ok().content_type(mime::TEXT_HTML).body(rendered.to_string()))
} }
let response = NamedFile::open(&path)? let response = NamedFile::open(&path)?