Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions salt/docs/config/nginx.docs-redirects.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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/;
}

Expand Down Expand Up @@ -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;
}

Expand Down
30 changes: 30 additions & 0 deletions tests/docs-redirects/specs/PEP-594.hurl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down
5 changes: 5 additions & 0 deletions tests/docs-redirects/specs/default-root.hurl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
30 changes: 30 additions & 0 deletions tests/docs-redirects/specs/surrogate-key.hurl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down