master
Edward Shen 2022-01-15 16:55:47 -08:00
parent c2bdd089e9
commit bccf84cfc1
Signed by: edward
GPG Key ID: 19182661E818369F
2 changed files with 3 additions and 4 deletions

View File

@ -97,7 +97,7 @@ async fn main() -> Result<()> {
.route("/:code", get(|| async { INDEX_PAGE }))
.nest("/static", root_service)
.route(
&format!("{}{}", API_ENDPOINT.to_string(), "/:code"),
&format!("{}{}", API_ENDPOINT, "/:code"),
get(paste::<SHORT_CODE_SIZE>).delete(delete::<SHORT_CODE_SIZE>),
)
.layer(AddExtensionLayer::new(db))

View File

@ -94,9 +94,8 @@ fn main() {
error!("Key is missing in url; bailing.");
render_message("Invalid paste link: Missing metadata.".into());
return;
} else {
fragment
}
fragment
} else {
error!("Key is missing in url; bailing.");
render_message("Invalid paste link: Missing metadata.".into());
@ -107,7 +106,7 @@ fn main() {
Ok(partial_parsed_url) => partial_parsed_url,
Err(e) => {
error!("Failed to parse text fragment; bailing.");
render_message(format!("Invalid paste link: {}", e.to_string()).into());
render_message(format!("Invalid paste link: {}", e).into());
return;
}
};