Skip to content

Commit

Permalink
chore(flaws): exclude /en-US/observatory/* from broken-link flaw (#11406
Browse files Browse the repository at this point in the history
)
  • Loading branch information
caugner authored Jul 4, 2024
1 parent 83d5075 commit 25c3064
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion build/flaws/broken-links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ export function getBrokenLinksFlaws(
} else if (
href.startsWith("https://developer.mozilla.org/") &&
!href.startsWith("https://developer.mozilla.org/en-US/curriculum/") &&
!href.startsWith("https://developer.mozilla.org/en-US/observatory") &&
!href.startsWith("https://developer.mozilla.org/en-US/blog/")
) {
// It might be a working 200 OK link but the link just shouldn't
Expand Down Expand Up @@ -285,7 +286,7 @@ export function getBrokenLinksFlaws(
} else if (
href.startsWith("/") &&
!href.startsWith("//") &&
!/^\/(discord|en-US\/(blog|curriculum))(\/|$)/.test(href)
!/^\/(discord|en-US\/(blog|curriculum|observatory))(\/|$)/.test(href)
) {
// Got to fake the domain to sensible extract the .search and .hash
const absoluteURL = new URL(href, "http://www.example.com");
Expand Down
2 changes: 1 addition & 1 deletion kumascript/macros/HTTPSidebar.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ var text = mdn.localStringMap({
<li><%-web.smartLink(`/${locale}/docs/Web/HTTP/Headers/X-Frame-Options`, null, "X-Frame-Options")%></li>
<li><%-web.smartLink(`/${locale}/docs/Web/HTTP/Headers/X-XSS-Protection`, null, "X-XSS-Protection")%></li>
<li><%-web.smartLink(`/${locale}/docs/Web/Security/Practical_implementation_guides`)%></li>
<li><a href="https://developer.mozilla.org/en-US/observatory">HTTP Observatory</a></li>
<li><a href="/en-US/observatory">HTTP Observatory</a></li>
</ol>
</details>
</li>
Expand Down

0 comments on commit 25c3064

Please sign in to comment.