From b5efd31fdd9d62c9f6011d0a7e740517ea9f780f Mon Sep 17 00:00:00 2001 From: baalajimaestro Date: Mon, 12 Dec 2022 00:01:48 +0530 Subject: [PATCH] Set appropriate contenttype Signed-off-by: baalajimaestro --- Cargo.lock | 1 + Cargo.toml | 1 + src/main.rs | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f27b0e5..f8fe226 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -991,6 +991,7 @@ version = "0.1.0" dependencies = [ "actix-web", "base64 0.20.0", + "mime", "reqwest", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 59b9b4e..1b4a710 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,3 +10,4 @@ serde = { version = "1.0", features = ["derive"] } reqwest = { version = "0.11", default-features = false, features = ["rustls-tls"] } serde_json = "1.0.89" base64 = "0.20.0" +mime = "0.3.16" diff --git a/src/main.rs b/src/main.rs index 135b5fc..1b68717 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,9 @@ -use actix_web::{get, App, HttpResponse, HttpServer, Responder, web::{Data, Query}}; +use actix_web::{get, App, HttpResponse, HttpServer, Responder, web::{Data, Query}, http::header::ContentType}; use tera::{Tera, Context}; use serde::{Serialize, Deserialize}; use reqwest::{Client, header::HeaderMap}; use std::env; +use mime::TEXT_HTML; struct Template { paste: Tera, @@ -54,7 +55,7 @@ async fn paste_render(data: Data