We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 815145b commit f894083Copy full SHA for f894083
worker/index.ts
@@ -31,6 +31,25 @@ export default class extends WorkerEntrypoint<Env> {
31
console.error("Could not evaluate redirects", error);
32
}
33
34
+ try {
35
+ const forceTrailingSlashURL = new URL(
36
+ request.url.replace(/([^/])$/, "$1/"),
37
+ request.url,
38
+ );
39
+ const redirect = await redirectsEvaluator(
40
+ new Request(forceTrailingSlashURL, request),
41
+ this.env.ASSETS,
42
43
+ if (redirect) {
44
+ return redirect;
45
+ }
46
+ } catch (error) {
47
+ console.error(
48
+ "Could not evaluate redirects with a forced trailing slash",
49
+ error,
50
51
52
+
53
try {
54
return await functions.fetch(request, this.env, this.ctx);
55
} catch (error) {
0 commit comments