Merge pull request #1253 from Demonthos/fix-map-route

Fix finding files with a custom map_path
This commit is contained in:
Jonathan Kelley 2023-07-31 17:28:03 -07:00 committed by GitHub
commit f704d81519
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -190,10 +190,7 @@ impl IncrementalRenderer {
} }
fn find_file(&self, route: &str) -> Option<ValidCachedPath> { fn find_file(&self, route: &str) -> Option<ValidCachedPath> {
let mut file_path = self.static_dir.clone(); let mut file_path = (self.map_path)(route);
for segment in route.split('/') {
file_path.push(segment);
}
if let Some(deadline) = self.invalidate_after { if let Some(deadline) = self.invalidate_after {
// find the first file that matches the route and is a html file // find the first file that matches the route and is a html file
file_path.push("index"); file_path.push("index");