parent
e577411356
commit
ab38909e34
1 changed files with 6 additions and 2 deletions
|
@ -211,13 +211,17 @@ mod iron_support {
|
|||
|
||||
#[cfg(feature = "rocket")]
|
||||
mod rocket_support {
|
||||
use rocket::http::Status;
|
||||
use rocket::http::{ContentType, Status};
|
||||
use rocket::response::{Responder, Response};
|
||||
use std::io::Cursor;
|
||||
use PreEscaped;
|
||||
|
||||
impl Responder<'static> for PreEscaped<String> {
|
||||
fn respond(self) -> Result<Response<'static>, Status> {
|
||||
self.into_string().respond()
|
||||
Response::build()
|
||||
.header(ContentType::HTML)
|
||||
.sized_body(Cursor::new(self.0))
|
||||
.ok()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue