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