mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-08 21:24:56 -05:00
start a new React-based UI (#111)
This doesn't do much yet but should provide a better foundation for improvement than the jQuery UI, as described in the github issue.
This commit is contained in:
@@ -1233,12 +1233,18 @@ struct StaticFileRequest<'a> {
|
||||
|
||||
impl<'a> StaticFileRequest<'a> {
|
||||
fn parse(path: &'a str) -> Option<Self> {
|
||||
if !path.starts_with("/") {
|
||||
if !path.starts_with("/") || path == "/index.html" {
|
||||
return None;
|
||||
}
|
||||
|
||||
let (path, immutable) = match &path[1..] {
|
||||
// These well-known URLs don't have content hashes in them, and
|
||||
// thus aren't immutable.
|
||||
"" => ("index.html", false),
|
||||
"robots.txt" => ("robots.txt", false),
|
||||
"site.webmanifest" => ("site.webmanifest", false),
|
||||
|
||||
// Everything else should.
|
||||
p => (p, true),
|
||||
};
|
||||
|
||||
@@ -1253,7 +1259,10 @@ impl<'a> StaticFileRequest<'a> {
|
||||
"js" | "map" => "text/javascript",
|
||||
"json" => "application/json",
|
||||
"png" => "image/png",
|
||||
"webapp" => "application/x-web-app-manifest+json",
|
||||
"webmanifest" => "application/manifest+json",
|
||||
"txt" => "text/plain",
|
||||
"woff2" => "font/woff2",
|
||||
"css" => "text/css",
|
||||
_ => return None,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user