Skip to content

Add max age to HLS CORS preflight responses#5759

Draft
modeitsch wants to merge 1 commit into
bluenviron:mainfrom
modeitsch:issue-5755-hls-cors-max-age
Draft

Add max age to HLS CORS preflight responses#5759
modeitsch wants to merge 1 commit into
bluenviron:mainfrom
modeitsch:issue-5755-hls-cors-max-age

Conversation

@modeitsch
Copy link
Copy Markdown

Fixes #5755.

This adds Access-Control-Max-Age: 86400 to HLS CORS preflight responses so browsers can cache successful preflight checks instead of sending an OPTIONS request before every segment request.

The existing HLS preflight test now verifies the new header.

Tests:

  • go test ./internal/servers/hls -run TestServerPreflightRequest -count=1
  • go test ./internal/servers/hls -count=1

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.09%. Comparing base (cdea2dc) to head (f8bbb7c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5759      +/-   ##
==========================================
+ Coverage   63.06%   63.09%   +0.02%     
==========================================
  Files         217      217              
  Lines       18364    18365       +1     
==========================================
+ Hits        11581    11587       +6     
+ Misses       5841     5836       -5     
  Partials      942      942              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Add Access-Control-Max-Age header to reduce OPTIONS requests

1 participant