Quellcode durchsuchen

Decode raw snippets to avoid > etc

master
Dylan Baker vor 5 Jahren
Ursprung
Commit
698c97bcc1
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1
    1
      src/routes.rs

+ 1
- 1
src/routes.rs Datei anzeigen

@@ -50,7 +50,7 @@ pub fn show_snippet(uuid: String, connection: DbConn) -> Template {
50 50
 #[get("/snippets/<uuid>/raw")]
51 51
 pub fn show_raw_snippet(uuid: String, connection: DbConn) -> String {
52 52
     match snippet::get(&connection, &uuid) {
53
-        Ok(snippet) => snippet.body,
53
+        Ok(snippet) => htmlescape::decode_html(&snippet.body).expect("Invalid HTML"),
54 54
         Err(_) => String::from("Snippet not found"),
55 55
     }
56 56
 }

Laden…
Abbrechen
Speichern