From ad64ce52a5b1058129c1f75d907999a8e1cc5650 Mon Sep 17 00:00:00 2001 From: A1lo Date: Sun, 8 Oct 2023 13:46:44 +0800 Subject: [PATCH] chore(redirects): remove broken redirect rules (#9762) Co-authored-by: Claas Augner <495429+caugner@users.noreply.github.com> --- libs/fundamental-redirects/index.js | 69 ------------------- testing/integration/headless/map_301.py | 61 ---------------- .../integration/headless/test_redirects.py | 9 --- testing/tests/redirects.test.ts | 61 ---------------- 4 files changed, 200 deletions(-) diff --git a/libs/fundamental-redirects/index.js b/libs/fundamental-redirects/index.js index cfec562eca24..48497e13ed76 100644 --- a/libs/fundamental-redirects/index.js +++ b/libs/fundamental-redirects/index.js @@ -317,75 +317,6 @@ const SCL3_REDIRECT_PATTERNS = [ "/docs/Web/API/CanvasRenderingContext2D.globalCompositeOperation", { permanent: true } ), - //################################## - // MOZILLADEMOS - //################################## - // canvas images - redirect( - /^samples\/canvas-tutorial\/images\/backdrop.png$/i, - "https://mdn.mozillademos.org/files/5395/backdrop.png", - { permanent: true } - ), - redirect( - /^samples\/canvas-tutorial\/images\/bg_gallery.png$/i, - "https://mdn.mozillademos.org/files/5415/bg_gallery.png", - { permanent: true } - ), - redirect( - /^samples\/canvas-tutorial\/images\/gallery_1.jpg$/i, - "https://mdn.mozillademos.org/files/5399/gallery_1.jpg", - { permanent: true } - ), - redirect( - /^samples\/canvas-tutorial\/images\/gallery_2.jpg$/i, - "https://mdn.mozillademos.org/files/5401/gallery_2.jpg", - { permanent: true } - ), - redirect( - /^samples\/canvas-tutorial\/images\/gallery_3.jpg$/i, - "https://mdn.mozillademos.org/files/5403/gallery_3.jpg", - { permanent: true } - ), - redirect( - /^samples\/canvas-tutorial\/images\/gallery_4.jpg$/i, - "https://mdn.mozillademos.org/files/5405/gallery_4.jpg", - { permanent: true } - ), - redirect( - /^samples\/canvas-tutorial\/images\/gallery_5.jpg$/i, - "https://mdn.mozillademos.org/files/5407/gallery_5.jpg", - { permanent: true } - ), - redirect( - /^samples\/canvas-tutorial\/images\/gallery_6.jpg$/i, - "https://mdn.mozillademos.org/files/5409/gallery_6.jpg", - { permanent: true } - ), - redirect( - /^samples\/canvas-tutorial\/images\/gallery_7.jpg$/i, - "https://mdn.mozillademos.org/files/5411/gallery_7.jpg", - { permanent: true } - ), - redirect( - /^samples\/canvas-tutorial\/images\/gallery_8.jpg$/i, - "https://mdn.mozillademos.org/files/5413/gallery_8.jpg", - { permanent: true } - ), - redirect( - /^samples\/canvas-tutorial\/images\/picture_frame.png$/i, - "https://mdn.mozillademos.org/files/242/Canvas_picture_frame.png", - { permanent: true } - ), - redirect( - /^samples\/canvas-tutorial\/images\/rhino.jpg$/i, - "https://mdn.mozillademos.org/files/5397/rhino.jpg", - { permanent: true } - ), - redirect( - /^samples\/canvas-tutorial\/images\/wallpaper.png$/i, - "https://mdn.mozillademos.org/files/222/Canvas_createpattern.png", - { permanent: true } - ), // canvas example in samples/domref redirect( /^samples\/domref\/mozGetAsFile.html$/i, diff --git a/testing/integration/headless/map_301.py b/testing/integration/headless/map_301.py index 856026e64683..fc1279ee5986 100644 --- a/testing/integration/headless/map_301.py +++ b/testing/integration/headless/map_301.py @@ -469,67 +469,6 @@ ) ) -# Converted from SCL3 Apache files - move to untrusted domain -MOZILLADEMOS_URLS = list( - flatten( - ( - # https://mdn.mozillademos.org/ - url_test( - "/samples/canvas-tutorial/images/backdrop.png", - "https://mdn.mozillademos.org/files/5395/backdrop.png", - ), - url_test( - "/samples/canvas-tutorial/images/bg_gallery.png", - "https://mdn.mozillademos.org/files/5415/bg_gallery.png", - ), - url_test( - "/samples/canvas-tutorial/images/gallery_1.jpg", - "https://mdn.mozillademos.org/files/5399/gallery_1.jpg", - ), - url_test( - "/samples/canvas-tutorial/images/gallery_2.jpg", - "https://mdn.mozillademos.org/files/5401/gallery_2.jpg", - ), - url_test( - "/samples/canvas-tutorial/images/gallery_3.jpg", - "https://mdn.mozillademos.org/files/5403/gallery_3.jpg", - ), - url_test( - "/samples/canvas-tutorial/images/gallery_4.jpg", - "https://mdn.mozillademos.org/files/5405/gallery_4.jpg", - ), - url_test( - "/samples/canvas-tutorial/images/gallery_5.jpg", - "https://mdn.mozillademos.org/files/5407/gallery_5.jpg", - ), - url_test( - "/samples/canvas-tutorial/images/gallery_6.jpg", - "https://mdn.mozillademos.org/files/5409/gallery_6.jpg", - ), - url_test( - "/samples/canvas-tutorial/images/gallery_7.jpg", - "https://mdn.mozillademos.org/files/5411/gallery_7.jpg", - ), - url_test( - "/samples/canvas-tutorial/images/gallery_8.jpg", - "https://mdn.mozillademos.org/files/5413/gallery_8.jpg", - ), - url_test( - "/samples/canvas-tutorial/images/picture_frame.png", - "https://mdn.mozillademos.org/files/242/Canvas_picture_frame.png", - ), - url_test( - "/samples/canvas-tutorial/images/rhino.jpg", - "https://mdn.mozillademos.org/files/5397/rhino.jpg", - ), - url_test( - "/samples/canvas-tutorial/images/wallpaper.png", - "https://mdn.mozillademos.org/files/222/Canvas_createpattern.png", - ), - ) - ) -) - # These are the remaining "samples/*" URL's, the ones that haven't been redirected # by any of the special cases, which we expect to be redirected to the media CDN. DEFAULT_SAMPLES_URLS = [ diff --git a/testing/integration/headless/test_redirects.py b/testing/integration/headless/test_redirects.py index 201ea52139cb..c8e45b40bc2d 100644 --- a/testing/integration/headless/test_redirects.py +++ b/testing/integration/headless/test_redirects.py @@ -11,7 +11,6 @@ LEGACY_URLS, MARIONETTE_URLS, MISC_REDIRECT_URLS, - MOZILLADEMOS_URLS, REDIRECT_URLS, SCL3_REDIRECT_URLS, WEBEXT_URLS, @@ -38,14 +37,6 @@ def test_github_redirects(url, base_url): assert_valid_url(**url) -@pytest.mark.parametrize( - "url", MOZILLADEMOS_URLS, ids=[item["url"] for item in MOZILLADEMOS_URLS] -) -def test_mozillademos_redirects(url, base_url): - url["base_url"] = base_url - assert_valid_url(**url) - - @pytest.mark.parametrize( "url", DEFAULT_SAMPLES_URLS, ids=[item["url"] for item in DEFAULT_SAMPLES_URLS] ) diff --git a/testing/tests/redirects.test.ts b/testing/tests/redirects.test.ts index 0a791adc6ee7..51ea8521458f 100644 --- a/testing/tests/redirects.test.ts +++ b/testing/tests/redirects.test.ts @@ -488,61 +488,6 @@ const GITHUB_IO_URLS = [].concat( ) ); -const MOZILLADEMOS_URLS = [].concat( - url_test( - "/samples/canvas-tutorial/images/backdrop.png", - "https://mdn.mozillademos.org/files/5395/backdrop.png" - ), - url_test( - "/samples/canvas-tutorial/images/bg_gallery.png", - "https://mdn.mozillademos.org/files/5415/bg_gallery.png" - ), - url_test( - "/samples/canvas-tutorial/images/gallery_1.jpg", - "https://mdn.mozillademos.org/files/5399/gallery_1.jpg" - ), - url_test( - "/samples/canvas-tutorial/images/gallery_2.jpg", - "https://mdn.mozillademos.org/files/5401/gallery_2.jpg" - ), - url_test( - "/samples/canvas-tutorial/images/gallery_3.jpg", - "https://mdn.mozillademos.org/files/5403/gallery_3.jpg" - ), - url_test( - "/samples/canvas-tutorial/images/gallery_4.jpg", - "https://mdn.mozillademos.org/files/5405/gallery_4.jpg" - ), - url_test( - "/samples/canvas-tutorial/images/gallery_5.jpg", - "https://mdn.mozillademos.org/files/5407/gallery_5.jpg" - ), - url_test( - "/samples/canvas-tutorial/images/gallery_6.jpg", - "https://mdn.mozillademos.org/files/5409/gallery_6.jpg" - ), - url_test( - "/samples/canvas-tutorial/images/gallery_7.jpg", - "https://mdn.mozillademos.org/files/5411/gallery_7.jpg" - ), - url_test( - "/samples/canvas-tutorial/images/gallery_8.jpg", - "https://mdn.mozillademos.org/files/5413/gallery_8.jpg" - ), - url_test( - "/samples/canvas-tutorial/images/picture_frame.png", - "https://mdn.mozillademos.org/files/242/Canvas_picture_frame.png" - ), - url_test( - "/samples/canvas-tutorial/images/rhino.jpg", - "https://mdn.mozillademos.org/files/5397/rhino.jpg" - ), - url_test( - "/samples/canvas-tutorial/images/wallpaper.png", - "https://mdn.mozillademos.org/files/222/Canvas_createpattern.png" - ) -); - const DEFAULT_SAMPLES_URLS = [].concat( url_test("/samples/cssref/background.html", null, { statusCode: 302 }), url_test("/samples/html/progress.html", null, { statusCode: 302 }) @@ -1326,12 +1271,6 @@ describe("github io redirects", () => { } }); -describe("mozilla demos redirects", () => { - for (const [url, t] of MOZILLADEMOS_URLS) { - it(url, t); - } -}); - describe("default samples redirects", () => { for (const [url, t] of DEFAULT_SAMPLES_URLS) { it(url, t);