Use / for raw pastes

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
Gunwant Jain
2022-02-07 01:59:41 +05:30
parent 2ab7ddb9c8
commit 884be16dc4

View File

@@ -7,13 +7,13 @@ use crate::models::paste_id::PasteId;
use crate::models::pretty_syntax::PasteIdSyntax;
use crate::models::response_wrapper::ResponseWrapper;
#[get("/r/<id>", rank = 2)]
#[get("/<id>", rank = 2)]
pub async fn retrieve(id: PasteId<'_>) -> ResponseWrapper<File> {
retrieve_inner(&id.to_string()).await
}
// rank 1 here because this would be more oftenly used
#[get("/r/<id_ext>", rank = 1)]
#[get("/<id_ext>", rank = 1)]
pub async fn retrieve_ext(id_ext: PasteIdSyntax<'_>) -> ResponseWrapper<File> {
retrieve_inner(&id_ext.get_fname().to_string()).await
}