From 773932dd852cf488b60161a372598b185e3cca42 Mon Sep 17 00:00:00 2001 From: Dan Ponte Date: Wed, 1 Mar 2023 11:20:29 -0500 Subject: [PATCH] Set MIME type when pretty --- src/server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.rs b/src/server.rs index 3f99765..874bd6d 100644 --- a/src/server.rs +++ b/src/server.rs @@ -96,7 +96,7 @@ async fn serve( let overrides = &config.paste.highlight_override; values.insert("type", if overrides.contains_key(&mime_str) { overrides[&mime_str].as_str() } else { "" }); 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)?