Linter replaces MDN url anchor when page is now redirecting to anchor
Nobody has claimed this yet.
- Dominant language
- JSON
- Stars
- 5.8k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 186
Description
What type of issue is this?
Linter issue
What is the issue?
If a feature has an mdn_url that points to an anchor of an MDN page, and that page is removed and redirected to another page with an anchor, then this redirect target replaces the mdn_url and the current anchor gets lost, even if the redirect target has an anchor corresponding to the old mdn_url.
diff --git a/http/headers/Content-Security-Policy.json b/http/headers/Content-Security-Policy.json
index 6c1ee46a99cd45..64dc4a85df7bdc 100644
--- a/http/headers/Content-Security-Policy.json
+++ b/http/headers/Content-Security-Policy.json
@@ -746,7 +746,7 @@
"report-sample": {
"__compat": {
"description": "`report-sample` source value",
- "mdn_url": "https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/Sources#report-sample",
+ "mdn_url": "https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy#fetch_directive_syntax",
"support": {
"chrome": {
"version_added": "59"
@@ -1152,7 +1152,7 @@
"strict-dynamic": {
"__compat": {
"description": "`strict-dynamic` source value",
- "mdn_url": "https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/Sources#strict-dynamic",
+ "mdn_url": "https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy#fetch_directive_syntax",
"support": {
"chrome": {
"version_added": "52"
@@ -1338,7 +1338,7 @@
"unsafe-hashes": {
"__compat": {
"description": "`unsafe-hashes` source value",
- "mdn_url": "https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/Sources#unsafe-hashes",
+ "mdn_url": "https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy#fetch_directive_syntax",
"support": {
"chrome": {
"version_added": "69"
What behavior were you expecting?
We should have not overwritten these specific MDN urls.
What version(s) of BCD is the issue present in?
- The current BCD release
- The current version of the
mainbranch
Do you have anything more you want to share?
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the linter change shown in Content-Security-Policy.json and inspect the linter logic that follows MDN redirects. Check how URLs with anchors are handled when both the original and redirect target contain anchors. Done means the existing anchor is preserved rather than replaced by the redirect target's page URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100