diff --git a/server/src/main.rs b/server/src/main.rs index 363604e..899e34e 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -3,7 +3,11 @@ extern crate rocket; use std::{error::Error, process::Command, str::FromStr}; -use rocket::{response::Debug, serde::json::Json, State}; +use rocket::{ + response::{content::Plain, Debug}, + serde::json::Json, + State, +}; use rocket_cors::{AllowedHeaders, AllowedOrigins}; use notmuch::{MessageId, Notmuch, NotmuchError, SearchSummary, ThreadSet}; @@ -29,14 +33,14 @@ async fn show(nm: &State, query: &str) -> Result, Debug } #[get("/original/")] -async fn original(nm: &State, id: &str) -> Result, Debug> { +async fn original(nm: &State, id: &str) -> Result>, Debug> { let mid = if id.starts_with("id:") { id.to_string() } else { format!("id:{}", id) }; let res = nm.show_original(&mid)?; - Ok(res) + Ok(Plain(res)) } #[rocket::main]