Skip to content

Commit 36e8672

Browse files
WC-3584 Move the limited response page to be inlined
There's no loader configured for html files by default in wrangler it seems. So rather than mess with loaders or a custom build, inlining this page is easy enough
1 parent 02cd216 commit 36e8672

File tree

3 files changed

+22
-26
lines changed

3 files changed

+22
-26
lines changed

packages/workers-shared/router-worker/src/limited-response.html

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/workers-shared/router-worker/src/worker.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { setupSentry } from "../../utils/sentry";
44
import { mockJaegerBinding } from "../../utils/tracing";
55
import { Analytics, DISPATCH_TYPE, STATIC_ROUTING_DECISION } from "./analytics";
66
import { applyConfigurationDefaults } from "./configuration";
7-
import limitedResponse from "./limited-response.html";
87
import type AssetWorker from "../../asset-worker/src/worker";
98
import type {
109
EyeballRouterConfig,
@@ -14,6 +13,28 @@ import type {
1413
} from "../../utils/types";
1514
import type { ColoMetadata, Environment, ReadyAnalytics } from "./types";
1615

16+
const limitedResponse = `<html>
17+
<head>
18+
<title>This website is temporarily limited</title>
19+
</head>
20+
<body>
21+
<h1>This website has been temporarily rate limited</h1>
22+
<p>
23+
You cannot access this site because the owner has reached their plan
24+
limits. Check back later once traffic has gone down.
25+
</p>
26+
<p>
27+
If you are owner of this website, prevent this from happening again by
28+
upgrading your plan on the
29+
<a
30+
href="https://dash.cloudflare.com/?account=workers/plans"
31+
target="_blank"
32+
>Cloudflare Workers dashboard</a
33+
>.
34+
</p>
35+
</body>
36+
</html>`;
37+
1738
export interface Env {
1839
ASSET_WORKER: Service<AssetWorker>;
1940
USER_WORKER: Fetcher;

packages/workers-shared/router-worker/types.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)