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 e8fac08Copy full SHA for e8fac08
worker/index.ts
@@ -31,6 +31,22 @@ 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("Could not evaluate redirects", error);
48
49
+
50
try {
51
return await functions.fetch(request, this.env, this.ctx);
52
} catch (error) {
0 commit comments