From 85ee060a50baf2896c776c4f8a0de7037f517838 Mon Sep 17 00:00:00 2001 From: Kaczanowski Mateusz Date: Sat, 9 May 2020 03:50:49 +0200 Subject: [PATCH] add github url --- src/main.rs | 11 ++--------- static/custom.css | 4 ++++ static/index.html | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index e48f320..031e44b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -274,9 +274,8 @@ fn get_url(cfg: &PastebinConfig) -> String { } } -fn get_error_response(html: String, status: Status, cfg: &PastebinConfig) -> Response { +fn get_error_response<'r>(html: String, status: Status) -> Response<'r> { let map = btreemap! { - "hostname" => cfg.address.as_str(), "version" => VERSION, "is_error" => "true", }; @@ -330,7 +329,6 @@ fn get<'r>( lang: Option, state: State<'r, DB>, resources: State<'r, HashMap<&str, &[u8]>>, - cfg: State, ) -> Response<'r> { let html = String::from_utf8_lossy(resources.get("../static/index.html").unwrap()).to_string(); @@ -344,7 +342,6 @@ fn get<'r>( }; let map = btreemap! { - "hostname" => cfg.address.as_str(), "version" => VERSION, "is_error" => "true", }; @@ -371,7 +368,6 @@ fn get<'r>( "pastebin_code" => std::str::from_utf8(entry.data().unwrap()).unwrap().to_string(), "pastebin_id" => id, "pastebin_language" => selected_lang, - "hostname" => cfg.address.clone(), "version" => VERSION.to_string(), }; @@ -409,7 +405,6 @@ fn get<'r>( fn get_new<'r>( state: State<'r, DB>, resources: State<'r, HashMap<&str, &[u8]>>, - cfg: State, id: Option, level: Option, glyph: Option, @@ -425,7 +420,6 @@ fn get_new<'r>( let mut map = btreemap! { "is_editable" => "true", - "hostname" => cfg.address.as_str(), "version" => VERSION, "msg" => msg.as_str(), "level" => level.as_str(), @@ -497,7 +491,6 @@ fn get_binary(id: String, state: State) -> Response { fn get_static<'r>( resource: String, resources: State<'r, HashMap<&str, &[u8]>>, - cfg: State<'r, PastebinConfig>, ) -> Response<'r> { let pth = format!("../static/{}", resource); let ext = get_extension(resource.as_str()).replace(".", ""); @@ -507,7 +500,7 @@ fn get_static<'r>( None => { let html = String::from_utf8_lossy(resources.get("../static/index.html").unwrap()).to_string(); - return get_error_response(html, Status::NotFound, cfg.inner()); + return get_error_response(html, Status::NotFound); } }; let content_type = ContentType::from_extension(ext.as_str()).unwrap(); diff --git a/static/custom.css b/static/custom.css index 9f5c97f..ffe6040 100644 --- a/static/custom.css +++ b/static/custom.css @@ -18,6 +18,10 @@ body { background-color: #f5f5f5; } +.footer a { + color: #000; +} + .form-group textarea { margin: 0.5em 0px; } diff --git a/static/index.html b/static/index.html index cc88722..6295396 100644 --- a/static/index.html +++ b/static/index.html @@ -271,7 +271,7 @@ {{#if is_encrypted}}