Skip to content

Commit 4f82ea8

Browse files
committed
.
1 parent 0ee2a43 commit 4f82ea8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

public/__redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,7 @@
17371737
/cloudflare-one/tutorials/zsh-env-var/ /cloudflare-one/tutorials/cli/ 301
17381738

17391739
### DYNAMIC REDIRECTS ###
1740+
/*/index.html.md /:splat/index.md 301
17401741
/api-next/* /api/:splat 301
17411742
/changelog-next/* /changelog/:splat 301
17421743
/browser-rendering/quick-actions-rest-api/* /browser-rendering/rest-api/:splat 301

worker/index.worker.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ describe("Cloudflare Docs", () => {
6363
expect(response.status).toBe(301);
6464
expect(response.headers.get("Location")).toBe("/changelog/rss.xml");
6565
});
66+
67+
it("redirects /workers/index.html.md to /workers/index.md", async () => {
68+
const request = new Request("http://fakehost/workers/index.html.md");
69+
const response = await SELF.fetch(request, { redirect: "manual" });
70+
71+
expect(response.status).toBe(301);
72+
expect(response.headers.get("Location")).toBe("/workers/index.md");
73+
});
6674
});
6775

6876
describe("json endpoints", () => {

0 commit comments

Comments
 (0)