Explorar o código

Respond to any path with index.html

This is for the html5 location API to work correctly
Thomas Dy %!s(int64=9) %!d(string=hai) anos
pai
achega
8a87ccfdce
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      rust-server/src/handler.rs

+ 3 - 0
rust-server/src/handler.rs

@@ -111,6 +111,9 @@ impl Handler for SiteHandler {
                         res.send(b"Unauthorized").unwrap();
                     }
                 },
+                (&Get, _) => {
+                    res.send(INDEX_HTML.as_bytes()).unwrap();
+                },
                 _ => {
                     *res.status_mut() = NotFound;
                     res.send(b"Not Found").unwrap();