Serve directly from root

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
baalajimaestro 2023-09-07 23:54:09 +05:30
parent e21c1a73a6
commit 69a3c01a06
Signed by: baalajimaestro
GPG key ID: F93C394FE9BBAFD5
2 changed files with 2 additions and 2 deletions

View file

@ -53,7 +53,7 @@ async fn paste_render(data: Data<Template>, paste: Query<Paste>) -> impl Respond
headers.insert("PRIVATE-TOKEN", gitlab_token.parse().unwrap()); headers.insert("PRIVATE-TOKEN", gitlab_token.parse().unwrap());
let paste_content: String; let paste_content: String;
if paste.paste_id.is_some() { if paste.paste_id.is_some() {
let response = client.get(format!("{}/repository/files/paste%2F{}.md?ref=master", base_url, paste.paste_id.as_ref().unwrap())).headers(headers).send().await.unwrap(); let response = client.get(format!("{}/repository/files/{}?ref=master", base_url, paste.paste_id.as_ref().unwrap())).headers(headers).send().await.unwrap();
let response_code = response.status().as_str().to_string(); let response_code = response.status().as_str().to_string();
let response_json = response.text().await.unwrap(); let response_json = response.text().await.unwrap();
if response_code != "200" { if response_code != "200" {