Skip to content

fix: case-insensitive Link rel="alternate" per RFC 8288#72

Draft
toddr-bot wants to merge 1 commit intomainfrom
koan.toddr.bot/fix-link-rel-case-sensitivity
Draft

fix: case-insensitive Link rel="alternate" per RFC 8288#72
toddr-bot wants to merge 1 commit intomainfrom
koan.toddr.bot/fix-link-rel-case-sensitivity

Conversation

@toddr-bot
Copy link
Copy Markdown
Contributor

What

Make _parse_link_alternates() match the rel="alternate" link relation type case-insensitively.

Why

RFC 8288 §2.1.1 states that relation types are not case-sensitive. The previous regex required exact lowercase rel="alternate", which could miss alternate certificate chains from ACME servers that send Rel="Alternate" or REL="ALTERNATE". While Let's Encrypt uses lowercase, other ACME CAs (ZeroSSL, Google Trust, Buypass) may not.

How

Added the /i flag to the Link header regex in _parse_link_alternates().

Testing

Added t/Net-ACME2-link-alternates.t with 8 tests covering: no header, single/multiple alternates, mixed case (Alternate, ALTERNATE), non-alternate links filtered, whitespace variations. Full test suite passes.

🤖 Generated with Claude Code

RFC 8288 §2.1.1 states that relation types are case-insensitive.
_parse_link_alternates() was using a case-sensitive regex, which
could miss alternate certificate chains from ACME servers that send
Rel="Alternate" or similar variants.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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