@@ -63,6 +63,28 @@ describe("Cloudflare Docs", () => {
6363 expect ( response . headers . get ( "Location" ) ) . toBe ( "/products/" ) ;
6464 } ) ;
6565
66+ it ( "redirects /changelog/index.xml to /release-notes/index.xml" , async ( ) => {
67+ const request = new Request ( "http://fakehost/changelog/index.xml" ) ;
68+ const response = await SELF . fetch ( request , { redirect : "manual" } ) ;
69+ expect ( response . status ) . toBe ( 301 ) ;
70+ expect ( response . headers . get ( "Location" ) ) . toBe ( "/release-notes/index.xml" ) ;
71+ } ) ;
72+
73+ it ( "redirects /changelog-next/ to /changelog/" , async ( ) => {
74+ const request = new Request ( "http://fakehost/changelog-next/" ) ;
75+ const response = await SELF . fetch ( request , { redirect : "manual" } ) ;
76+ expect ( response . status ) . toBe ( 301 ) ;
77+ expect ( response . headers . get ( "Location" ) ) . toBe ( "/changelog/" ) ;
78+ } ) ;
79+
80+ it ( "redirects /changelog-next/rss.xml to /changelog/rss.xml" , async ( ) => {
81+ const request = new Request ( "http://fakehost/changelog-next/rss.xml" ) ;
82+ const response = await SELF . fetch ( request , { redirect : "manual" } ) ;
83+
84+ expect ( response . status ) . toBe ( 301 ) ;
85+ expect ( response . headers . get ( "Location" ) ) . toBe ( "/changelog/rss.xml" ) ;
86+ } ) ;
87+
6688 it ( "responds with 404.html at `/non-existent`" , async ( ) => {
6789 const request = new Request ( "http://fakehost/non-existent" ) ;
6890 const response = await SELF . fetch ( request ) ;
0 commit comments