Skip to content

fix(http/unstable): improve Cache Control parsing and types#7087

Open
tomas-zijdemans wants to merge 7 commits intodenoland:mainfrom
tomas-zijdemans:cache-control-stable
Open

fix(http/unstable): improve Cache Control parsing and types#7087
tomas-zijdemans wants to merge 7 commits intodenoland:mainfrom
tomas-zijdemans:cache-control-stable

Conversation

@tomas-zijdemans
Copy link
Copy Markdown
Contributor

@tomas-zijdemans tomas-zijdemans commented Apr 7, 2026

Breaking type changes:

  • Removed CacheControlBase; RequestCacheControl and ResponseCacheControl are now flat interfaces
  • CacheControl is now a merged mapped type instead of a union
  • staleIfError added to RequestCacheControl (per RFC 5861)

Bug fixes:

  • Handle backslash escapes inside quoted strings in splitDirectives
  • Normalize no-cache="" and private="" to true instead of []

Perf:

  • Hoist digit regex to module scope
  • Replace Set-based duplicate tracking with direct property checks

Tests: added coverage for duplicate directives (all branches), escaped quotes, empty field-name normalization, and round-trip stability.

@github-actions github-actions bot added the http label Apr 7, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.41%. Comparing base (1cd63ca) to head (197ce50).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7087   +/-   ##
=======================================
  Coverage   94.41%   94.41%           
=======================================
  Files         630      630           
  Lines       50490    50516   +26     
  Branches     8949     8972   +23     
=======================================
+ Hits        47669    47696   +27     
  Misses       2249     2249           
+ Partials      572      571    -1     

☔ 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.

@tomas-zijdemans tomas-zijdemans changed the title feat(http): stabilize Cache-Control helpers fix(http/unstable): improve Cache Control parsing and types Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant