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:
Scott Lamb
2021-01-31 21:55:25 -08:00
parent c547a49ac8
commit f281922359
67 changed files with 11454 additions and 8052 deletions

View File

@@ -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,
};