diff --git a/salt/docs/config/nginx.docs-redirects.conf b/salt/docs/config/nginx.docs-redirects.conf index d51358ae..3b1c16b4 100644 --- a/salt/docs/config/nginx.docs-redirects.conf +++ b/salt/docs/config/nginx.docs-redirects.conf @@ -8,7 +8,7 @@ location = / { } # Python 3 docs are the default at the root of each translation. -location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|tr|uk|zh-cn|zh-tw)/$ { +location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|sv|tr|uk|zh-cn|zh-tw)/$ { return 302 $scheme://$host/$1/3/; } @@ -190,7 +190,7 @@ location ~ ^/((2|3)(\.[0-9]+)?|dev)/\w+/[\d\w\.]+(?!\.html)$ { location ~ ^/((2|3)(\.[0-9]+)?|dev)/ { add_header Surrogate-Key en/$1 always; } -location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|tr|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ { +location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|tr|sv|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ { add_header Surrogate-Key $1/$2 always; } diff --git a/tests/docs-redirects/specs/PEP-594.hurl b/tests/docs-redirects/specs/PEP-594.hurl index 5b5168eb..0036a2ca 100644 --- a/tests/docs-redirects/specs/PEP-594.hurl +++ b/tests/docs-redirects/specs/PEP-594.hurl @@ -183,6 +183,21 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/ro/3.14/" +GET {{host}}/sv/3/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/sv/3/" + +GET {{host}}/sv/3.13/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/sv/3.13/" + +GET {{host}}/sv/3.14/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/sv/3.14/" + GET {{host}}/tr/3/library/2to3.html HTTP 301 [Asserts] @@ -425,6 +440,21 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/ro/3.14/" +GET {{host}}/sv/3/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/sv/3/" + +GET {{host}}/sv/3.13/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/sv/3.13/" + +GET {{host}}/sv/3.14/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/sv/3.14/" + GET {{host}}/tr/3/library/tkinter.tix.html HTTP 301 [Asserts] diff --git a/tests/docs-redirects/specs/default-root.hurl b/tests/docs-redirects/specs/default-root.hurl index 4ba8ed5a..6bc44202 100644 --- a/tests/docs-redirects/specs/default-root.hurl +++ b/tests/docs-redirects/specs/default-root.hurl @@ -63,6 +63,11 @@ HTTP 302 [Asserts] header "Location" == "http://localhost/ro/3/" +GET {{host}}/sv/ +HTTP 302 +[Asserts] +header "Location" == "http://localhost/sv/3/" + GET {{host}}/tr/ HTTP 302 [Asserts] diff --git a/tests/docs-redirects/specs/surrogate-key.hurl b/tests/docs-redirects/specs/surrogate-key.hurl index 7e0f1336..546054f4 100644 --- a/tests/docs-redirects/specs/surrogate-key.hurl +++ b/tests/docs-redirects/specs/surrogate-key.hurl @@ -625,6 +625,36 @@ HTTP 404 [Asserts] header "Surrogate-Key" == "ro/dev" +GET {{host}}/sv/3/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "sv/3" + +GET {{host}}/sv/3/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "sv/3" + +GET {{host}}/sv/3.14/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "sv/3.14" + +GET {{host}}/sv/3.14/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "sv/3.14" + +GET {{host}}/sv/dev/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "sv/dev" + +GET {{host}}/sv/dev/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "sv/dev" + GET {{host}}/tr/3/ HTTP 404 [Asserts]