Skip to content

Refine response metadata defaults for negotiated responses#164

Merged
alganet merged 1 commit intoRespect:masterfrom
alganet:conneg
Mar 17, 2026
Merged

Refine response metadata defaults for negotiated responses#164
alganet merged 1 commit intoRespect:masterfrom
alganet:conneg

Conversation

@alganet
Copy link
Member

@alganet alganet commented Mar 17, 2026

Introduce a small request-level response metadata API so routines can communicate through replace/append/default header semantics instead of overwriting one shared header bag.

Changes:

  • add Request helpers for explicit, appended, and default response headers
  • apply appended headers by merging with handler-provided response headers and apply default headers only when the response does not already define them
  • clear stale routine metadata between candidate route matches
  • update Accept* routines to use the new metadata API
  • stop emitting automatic Expires and Cache-Control headers for negotiated responses
  • keep negotiated representation headers while making Content-Location a default that a handler may override
  • preserve explicit response headers such as Cache-Control returned by the route handler

Tests:

  • update negotiation metadata expectations to no longer require automatic cache

Introduce a small request-level response metadata API so routines can
communicate through replace/append/default header semantics instead of
overwriting one shared header bag.

Changes:
- add Request helpers for explicit, appended, and default response headers
- apply appended headers by merging with handler-provided response headers
  and apply default headers only when the response does not already define them
- clear stale routine metadata between candidate route matches
- update Accept* routines to use the new metadata API
- stop emitting automatic Expires and Cache-Control headers for negotiated
  responses
- keep negotiated representation headers while making Content-Location a
  default that a handler may override
- preserve explicit response headers such as Cache-Control returned by the
  route handler

Tests:
- update negotiation metadata expectations to no longer require automatic
  cache
@alganet alganet marked this pull request as ready for review March 17, 2026 22:04
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.46%. Comparing base (7a9d34b) to head (a2fc582).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #164      +/-   ##
============================================
+ Coverage     96.30%   96.46%   +0.16%     
- Complexity      433      441       +8     
============================================
  Files            27       27              
  Lines          1055     1076      +21     
============================================
+ Hits           1016     1038      +22     
+ Misses           39       38       -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.

@alganet alganet merged commit e2a76c4 into Respect:master Mar 17, 2026
3 checks passed
@alganet alganet deleted the conneg branch March 17, 2026 22:08
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