feat(w3c/headers): validate header links - #5143
Conversation
5982fb1 to
721ec7b
Compare
There was a problem hiding this comment.
Pull request overview
This PR enhances W3C header handling by adding validation/verification around key header links (notably latestVersion and historyURI) and extends the test suite to cover the new behaviors, aiming to surface broken header links earlier via warnings/errors.
Changes:
- Add a HEAD check for derived
latestVersionURLs and emit aw3c/headerswarning when the URL can’t be reached. - Adjust
historyURIderivation to support explicit suppression (null) and refactor URL probing intoresourceExists(). - Update/extend
w3c/headerstests (warnings filter, status loops, new warning expectation).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
tests/spec/w3c/headers-spec.js |
Adds warnings assertions and refactors status-based tests for header link behavior. |
src/w3c/templates/cgbg-headers.js |
Tweaks when the “Latest published version” row is rendered for CG/BG headers. |
src/w3c/headers.js |
Adds URL existence probing for latestVersion, refactors history derivation, and introduces resourceExists(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/w3c/templates/cgbg-headers.js:47
conf.latestVersion !== null(and the nestedconf.latestVersion !== "") will treatundefinedas “present” and render an<a>whose href/text becomeundefined. The W3C headers template avoids this by checking property existence ("latestVersion" in conf) and then treating falsy values as “none”. Consider aligning the CGBG template logic (e.g., guard on property existence or use a nullish check) so missing/undefinedlatestVersioncan’t produce a broken link.
${conf.latestVersion !== null
? html`<dt>${l10n.latest_published_version}</dt>
<dd>
${conf.latestVersion !== ""
? html`<a href="${conf.latestVersion}"
>${conf.latestVersion}</a
>`
: "none"}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8ea26c4 to
a7a0832
Compare
|
@copilot please rebase |
I synced the branch updates and pushed the latest follow-up in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Rebase? |
I rebased this branch onto |
c9109eb to
ce0e61d
Compare
|
@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed? |
Confirmed: all previously raised review feedback is now addressed in the branch. I re-verified the key points ( No UI changes were made, so there’s no screenshot to attach. |
|
@copilot resolve the merge conflicts in this pull request |
Resolved the merge conflicts and merged |
aa3a2ce to
02f8813
Compare
edDraftURI,historyURI,implementationReportURI, and other header links are well-formed URLs pointing to the expected hostsWritten with AI: this change was generated by Claude. Per AI_POLICY.md.