| @@ -1,4 +1,12 @@ | |
| path => | path => { |
| match self.vfs.read(path) { | let resource = if self.vfs.read(path) is Some(content) { |
| Some((path, content)) | |
| } else if request_accepts_html(request) && | |
| self.html_fallback_path is Some(fallback) { | |
| self.vfs.read(fallback).map(content => (fallback, content)) | |
| } else { | |
| None | |
| } | |
| match resource { | |
| Some(content) => { | Some((resource_path, content)) => { |
| let content_type = match @path.Path::extname(path) { | let content_type = match @path.Path::extname(resource_path) { |
@@ -1,4 +1,12 @@ - path => - match self.vfs.read(path) { - Some(content) => { - let content_type = match @path.Path::extname(path) { + path => { + let resource = if self.vfs.read(path) is Some(content) { + Some((path, content)) + } else if request_accepts_html(request) && + self.html_fallback_path is Some(fallback) { + self.vfs.read(fallback).map(content => (fallback, content)) + } else { + None + } + match resource { + Some((resource_path, content)) => { + let content_type = match @path.Path::extname(resource_path) {