Skip to content

Commit

Permalink
add fundamental redirects for /en-US/Security/CSP (#3200)
Browse files Browse the repository at this point in the history
* add fundamental redirects for /en-US/Security/CSP

Fixes #3199

* Update libs/fundamental-redirects/index.js

Co-authored-by: Ryan Johnson <escattone@gmail.com>

* feedbacked

Co-authored-by: Ryan Johnson <escattone@gmail.com>
  • Loading branch information
peterbe and escattone authored Mar 11, 2021
1 parent 8fa25f2 commit 6d3e84d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libs/fundamental-redirects/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ const MISC_REDIRECT_PATTERNS = [
// redirects often take over from there, so let's only insert "/docs/"
// and let any other redirect rules work from that point onwards.
localeRedirect(
/^(?<prefix>AJAX|CSS|DOM|DragDrop|HTML|JavaScript|SVG|Tools|Using_files_from_web_applications|Web|XMLHttpRequest)(?<subPath>\/.+?)?\/?$/i,
/^(?<prefix>AJAX|CSS|DOM|DragDrop|HTML|JavaScript|SVG|Tools|Using_files_from_web_applications|Web|XMLHttpRequest|Security)(?<subPath>\/.+?)?\/?$/i,
({ prefix, subPath = "" }) => `/docs/${prefix}${subPath}`,
{ permanent: true }
),
Expand Down
3 changes: 3 additions & 0 deletions testing/integration/headless/map_301.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,9 @@
url_test("/en-US/XMLHttpRequest", "/en-US/docs/XMLHttpRequest"),
url_test("/en-US/XMLHttpRequest/", "/en-US/docs/XMLHttpRequest"),
url_test("/en-US/XMLHttpRequest/FormData/", "/en-US/docs/XMLHttpRequest/FormData"),
url_test("/en-US/Security", "/en-US/docs/Security"),
url_test("/en-US/Security/", "/en-US/docs/Security"),
url_test("/en-US/Security/CSP/", "/en-US/docs/Security/CSP"),
# Add trailing slash for the home page.
url_test("/en-US", "/en-US/"),
# Some special cases for "/docs".
Expand Down

0 comments on commit 6d3e84d

Please sign in to comment.