From 98157d5e4719a817684965d1f11d80e7499eb1df Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:25:05 +0100 Subject: [PATCH] Avoid multiple redirects in pre-2.5 paths (#518) --- salt/docs/config/nginx.docs-redirects.conf | 20 ++++++++++---------- tests/docs-redirects/specs/py2.5.hurl | 22 +++++++++++----------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/salt/docs/config/nginx.docs-redirects.conf b/salt/docs/config/nginx.docs-redirects.conf index 0f02d5c4..d7a6f1ba 100644 --- a/salt/docs/config/nginx.docs-redirects.conf +++ b/salt/docs/config/nginx.docs-redirects.conf @@ -199,32 +199,32 @@ location ~ ^/(es|fr|id|it|ja|ko|pl|pt-br|tr|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|de # Map old, 2.5-and-earlier directory names to 2.6-and-later names. location = /lib/ { - return 301 https://$host/library/; + return 301 https://$host/3/library/; } location ~ ^/lib/module-([a-zA-Z0-9.]+)\.html$ { - return 301 https://$host/library/$1.html; + return 301 https://$host/3/library/$1.html; } location = /tut/ { - return 301 https://$host/tutorial/; + return 301 https://$host/3/tutorial/; } location = /tut/tut.html { - return 301 https://$host/tutorial/; + return 301 https://$host/3/tutorial/; } location = /api/ { - return 301 https://$host/c-api/; + return 301 https://$host/3/c-api/; } location = /ext/ { - return 301 https://$host/extending/; + return 301 https://$host/3/extending/; } location = /dist/ { - return 301 https://docs.python.org/distutils/; + return 301 https://$host/3/; } location = /inst/ { - return 301 https://$host/install/; + return 301 https://$host/3/; } location = /doc/ { - return 301 https://devguide.python.org/documenting.html; + return 301 https://devguide.python.org/documentation/start-documenting/; } location = /ref/ { - return 301 https://$host/reference/; + return 301 https://$host/3/reference/; } diff --git a/tests/docs-redirects/specs/py2.5.hurl b/tests/docs-redirects/specs/py2.5.hurl index c32c0a77..fd983427 100644 --- a/tests/docs-redirects/specs/py2.5.hurl +++ b/tests/docs-redirects/specs/py2.5.hurl @@ -4,54 +4,54 @@ GET {{host}}/lib/ HTTP 301 [Asserts] -header "Location" == "https://localhost/library/" +header "Location" == "https://localhost/3/library/" GET {{host}}/lib/module-base64.html HTTP 301 [Asserts] -header "Location" == "https://localhost/library/base64.html" +header "Location" == "https://localhost/3/library/base64.html" GET {{host}}/lib/module-sys.html HTTP 301 [Asserts] -header "Location" == "https://localhost/library/sys.html" +header "Location" == "https://localhost/3/library/sys.html" GET {{host}}/tut/ HTTP 301 [Asserts] -header "Location" == "https://localhost/tutorial/" +header "Location" == "https://localhost/3/tutorial/" GET {{host}}/tut/tut.html HTTP 301 [Asserts] -header "Location" == "https://localhost/tutorial/" +header "Location" == "https://localhost/3/tutorial/" GET {{host}}/api/ HTTP 301 [Asserts] -header "Location" == "https://localhost/c-api/" +header "Location" == "https://localhost/3/c-api/" GET {{host}}/ext/ HTTP 301 [Asserts] -header "Location" == "https://localhost/extending/" +header "Location" == "https://localhost/3/extending/" GET {{host}}/dist/ HTTP 301 [Asserts] -header "Location" == "https://docs.python.org/distutils/" +header "Location" == "https://localhost/3/" GET {{host}}/inst/ HTTP 301 [Asserts] -header "Location" == "https://localhost/install/" +header "Location" == "https://localhost/3/" GET {{host}}/doc/ HTTP 301 [Asserts] -header "Location" == "https://devguide.python.org/documenting.html" +header "Location" == "https://devguide.python.org/documentation/start-documenting/" GET {{host}}/ref/ HTTP 301 [Asserts] -header "Location" == "https://localhost/reference/" +header "Location" == "https://localhost/3/reference/"