Skip to content

fix(cors): lowercase cors headers for rack 3 compatibility#42

Merged
jimehk merged 1 commit into
mainfrom
rack-3-response-header-compatibility
Oct 22, 2025
Merged

fix(cors): lowercase cors headers for rack 3 compatibility#42
jimehk merged 1 commit into
mainfrom
rack-3-response-header-compatibility

Conversation

@jimehk

@jimehk jimehk commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

Modify CORS headers to use lowercase keys for Rack 3.x compatibility.

In non-production environments Rack 3 throws lint errors instead of
rendering pages if any of the headers are capitalized. This is to
conform with the HTTP/2 specification.

Modify CORS headers to use lowercase keys for Rack 3.x compatibility.

In non-production environments Rack 3 throws lint errors instead of 
rendering pages if any of the headers are capitalized. This is to 
conform with the HTTP/2 specification.
@jimehk jimehk force-pushed the rack-3-response-header-compatibility branch from 38e9606 to 7b5388f Compare October 21, 2025 14:13
@jimehk jimehk requested review from adamcooke and Copilot October 22, 2025 09:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies CORS header keys to use lowercase format for Rack 3.x compatibility, conforming to the HTTP/2 specification which requires lowercase header names.

Key Changes:

  • Updated CORS header keys from PascalCase to lowercase in the core CORS module
  • Updated all test assertions to expect lowercase CORS header keys

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
lib/apia/cors.rb Updated CORS header keys from PascalCase (e.g., 'Access-Control-Allow-Origin') to lowercase (e.g., 'access-control-allow-origin')
spec/specs/apia/cors_spec.rb Updated test expectations and descriptions to use lowercase CORS header keys
spec/specs/apia/endpoint_spec.rb Updated test assertions to expect lowercase CORS header keys in response headers
spec/specs/apia/rack_spec.rb Updated test assertions to expect lowercase CORS header keys in Rack response headers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jimehk jimehk merged commit 859907a into main Oct 22, 2025
12 checks passed
@jimehk jimehk deleted the rack-3-response-header-compatibility branch October 22, 2025 09:48
@apiabot apiabot Bot mentioned this pull request Oct 22, 2025
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.

3 participants