|
|
|
@ -13,7 +13,7 @@ use mime;
|
|
|
|
|
use url::form_urlencoded;
|
|
|
|
|
|
|
|
|
|
use crate::config::Config;
|
|
|
|
|
use crate::html_error::create_error_response;
|
|
|
|
|
use crate::error_response::{create_html_error_response, create_text_error_response};
|
|
|
|
|
use crate::paste::Paste;
|
|
|
|
|
|
|
|
|
|
pub fn put(mut state: State) -> Box<HandlerFuture> {
|
|
|
|
@ -40,9 +40,8 @@ pub fn put(mut state: State) -> Box<HandlerFuture> {
|
|
|
|
|
),
|
|
|
|
|
Err(e) => {
|
|
|
|
|
error!("submit.rs(10): {:?}", e);
|
|
|
|
|
create_error_response(
|
|
|
|
|
create_text_error_response(
|
|
|
|
|
StatusCode::INTERNAL_SERVER_ERROR,
|
|
|
|
|
config.url,
|
|
|
|
|
&state,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
@ -50,9 +49,8 @@ pub fn put(mut state: State) -> Box<HandlerFuture> {
|
|
|
|
|
}
|
|
|
|
|
Err(e) => {
|
|
|
|
|
error!("submit.rs(20): {:?}", e);
|
|
|
|
|
create_error_response(
|
|
|
|
|
create_text_error_response(
|
|
|
|
|
StatusCode::INTERNAL_SERVER_ERROR,
|
|
|
|
|
config.url,
|
|
|
|
|
&state,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
@ -60,7 +58,7 @@ pub fn put(mut state: State) -> Box<HandlerFuture> {
|
|
|
|
|
}
|
|
|
|
|
Err(e) => {
|
|
|
|
|
error!("submit.rs(30): {:?}", e);
|
|
|
|
|
create_error_response(StatusCode::INTERNAL_SERVER_ERROR, config.url, &state)
|
|
|
|
|
create_text_error_response(StatusCode::INTERNAL_SERVER_ERROR, &state)
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -95,7 +93,7 @@ pub fn post(mut state: State) -> Box<HandlerFuture> {
|
|
|
|
|
.unwrap(),
|
|
|
|
|
Err(e) => {
|
|
|
|
|
error!("submit.rs(40): {:?}", e);
|
|
|
|
|
create_error_response(
|
|
|
|
|
create_html_error_response(
|
|
|
|
|
StatusCode::INTERNAL_SERVER_ERROR,
|
|
|
|
|
config.url,
|
|
|
|
|
&state,
|
|
|
|
@ -105,7 +103,7 @@ pub fn post(mut state: State) -> Box<HandlerFuture> {
|
|
|
|
|
}
|
|
|
|
|
Err(e) => {
|
|
|
|
|
error!("submit.rs(50): {:?}", e);
|
|
|
|
|
create_error_response(
|
|
|
|
|
create_html_error_response(
|
|
|
|
|
StatusCode::INTERNAL_SERVER_ERROR,
|
|
|
|
|
config.url,
|
|
|
|
|
&state,
|
|
|
|
@ -115,7 +113,7 @@ pub fn post(mut state: State) -> Box<HandlerFuture> {
|
|
|
|
|
}
|
|
|
|
|
Err(e) => {
|
|
|
|
|
error!("submit.rs(60): {:?}", e);
|
|
|
|
|
create_error_response(StatusCode::INTERNAL_SERVER_ERROR, config.url, &state)
|
|
|
|
|
create_html_error_response(StatusCode::INTERNAL_SERVER_ERROR, config.url, &state)
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|