Skip to content

Commit a1cd3f8

Browse files
matthewdavidrodgersemily-shen
authored andcommitted
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 7ceb1f2 commit a1cd3f8

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
@@ -7,7 +7,6 @@ import {
77
applyEyeballConfigDefaults,
88
applyRouterConfigDefaults,
99
} from "./configuration";
10-
import limitedResponse from "./limited-response.html";
1110
import type AssetWorker from "../../asset-worker";
1211
import type {
1312
EyeballRouterConfig,
@@ -17,6 +16,28 @@ import type {
1716
} from "../../utils/types";
1817
import type { ColoMetadata, Environment, ReadyAnalytics } from "./types";
1918

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