Skip to content

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

Merged
toddr merged 1 commit intomainfrom
koan.toddr.bot/fix-link-rel-case-sensitivity
Apr 23, 2026
Merged

fix: case-insensitive Link rel="alternate" per RFC 8288#72
toddr merged 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>
@toddr toddr marked this pull request as ready for review April 23, 2026 14:13
@toddr toddr merged commit a3b0c5d into main Apr 23, 2026
20 checks passed
@toddr toddr deleted the koan.toddr.bot/fix-link-rel-case-sensitivity branch April 23, 2026 14:13
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.

2 participants