Skip to content

fix: parse multiple Link header relations - #1863

Open
Aurantium-47 wants to merge 1 commit into
forwardemail:masterfrom
Aurantium-47:codex/fix-link-relation-lists
Open

Aurantium-47 wants to merge 1 commit into
forwardemail:masterfrom
Aurantium-47:codex/fix-link-relation-lists

Conversation

@Aurantium-47

Copy link
Copy Markdown

For Link: <https://example.com/page2>; rel="next last", res.links currently contains a single "next last" key, so callers following res.links.next miss the next page. RFC 8288 section 3.3 allows multiple space-separated relations for one target.

Split the relation value on ASCII spaces and apply the existing unsafe-key filter to each relation. The first-rel behavior is unchanged. Added parser regressions for repeated spaces and unsafe keys, plus a shared browser/Node HTTP response test.

Validation on Windows with Node 24: all three new regressions fail before the change; the complete HTTP/1 suite passes (410 passing, 9 pending), as does HTTP/2 (404 passing, 13 pending). Library/browser builds, source/generated-code lint, Markdown checks and commitlint pass. The complete shared test/basic.js suite passes in real Edge (48 tests); its new regression fails on the original parser. The broader browser suite has 207 passing and six existing failures, all six reproduced on the base. Independent checks cover 159 assertions against the original and patched parsers.

Prepared and tested with OpenAI Codex.

Checklist

  • I have ensured my pull request is not behind the main or master branch of the original repository.
  • I have rebased all commits where necessary so that reviewing this pull request can be done without having to merge it first.
  • I have written a commit message that passes commitlint linting.
  • I have ensured that my code changes pass linting tests.
  • I have ensured that my code changes pass unit tests.
  • I have described my pull request and the reasons for code changes along with context if necessary.

Split a rel value on ASCII spaces so res.links exposes every relation.
Keep unsafe-key filtering per relation and add parser and HTTP regressions.

Assisted-by: OpenAI GPT-6 <noreply@openai.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant