Skip to content

Commit d335f74

Browse files
committed
Bump [email protected] and raise limits
1 parent 12f2a51 commit d335f74

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"react-icons": "5.5.0",
9494
"react-instantsearch": "7.15.4",
9595
"react-markdown": "10.1.0",
96-
"redirects-in-workers": "0.0.5",
96+
"redirects-in-workers": "0.0.7",
9797
"rehype": "13.0.2",
9898
"rehype-autolink-headings": "7.1.0",
9999
"rehype-external-links": "3.0.0",

worker/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ import { WorkerEntrypoint } from "cloudflare:workers";
22
import { generateRedirectsEvaluator } from "redirects-in-workers";
33
import redirectsFileContents from "../dist/__redirects";
44

5-
const redirectsEvaluator = generateRedirectsEvaluator(redirectsFileContents);
5+
const redirectsEvaluator = generateRedirectsEvaluator(redirectsFileContents, {
6+
maxLineLength: 10_000, // Usually 2_000
7+
maxStaticRules: 10_000, // Usually 2_000
8+
maxDynamicRules: 2_000, // Usually 100
9+
});
610

711
export default class extends WorkerEntrypoint<Env> {
812
override async fetch(request: Request) {
913
try {
1014
try {
11-
// @ts-expect-error Ignore Fetcher type mismatch
1215
const redirect = await redirectsEvaluator(request, this.env.ASSETS);
1316
if (redirect) {
1417
return redirect;
@@ -24,7 +27,6 @@ export default class extends WorkerEntrypoint<Env> {
2427
);
2528
const redirect = await redirectsEvaluator(
2629
new Request(forceTrailingSlashURL, request),
27-
// @ts-expect-error Ignore Fetcher type mismatch
2830
this.env.ASSETS,
2931
);
3032
if (redirect) {

0 commit comments

Comments
 (0)