Browse Source

Decode raw snippets to avoid > etc

master
Dylan Baker 5 years ago
parent
commit
698c97bcc1
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/routes.rs

+ 1
- 1
src/routes.rs View File

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

Loading…
Cancel
Save