fix serving files with numbers in extension (#931)
parent
70d8a36e88
commit
be8c3303a4
|
@ -489,7 +489,7 @@ export class HttpServer {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const filePathRegex = "/:path{[^!].*\\.[a-zA-Z]+}";
|
const filePathRegex = "/:path{[^!].*\\.[a-zA-Z0-9]+}";
|
||||||
const mdExt = ".md";
|
const mdExt = ".md";
|
||||||
|
|
||||||
this.app.get(filePathRegex, async (c) => {
|
this.app.get(filePathRegex, async (c) => {
|
||||||
|
|
|
@ -103,7 +103,7 @@ self.addEventListener("fetch", (event: any) => {
|
||||||
pathname === "/index.json"
|
pathname === "/index.json"
|
||||||
) {
|
) {
|
||||||
return fetch(request);
|
return fetch(request);
|
||||||
} else if (/\/.+\.[a-zA-Z]+$/.test(pathname)) {
|
} else if (/\/.+\.[a-zA-Z0-9]+$/.test(pathname)) {
|
||||||
// If this is a /*.* request, this can either be a plug worker load or an attachment load
|
// If this is a /*.* request, this can either be a plug worker load or an attachment load
|
||||||
return handleLocalFileRequest(request, pathname);
|
return handleLocalFileRequest(request, pathname);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue