Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: header defaults in Caddyfile must be in separate handlers #1893

Merged
merged 1 commit into from Apr 24, 2021

Conversation

francislavoie
Copy link
Contributor

Discussion in caddyserver/caddy#4130 brought this up.

There's a bit of a gotcha here, in that having two ?Field headers will append each to the Require response matcher, so those header fields will only be set if both are not present in the response. If one is present (e.g. Link is in the response) then neither are set.

Using separate header handlers solves this because they will use their own handlers, and therefore separate response matchers.

This is just a followup to #1879 to fix this non-obvious behaviour.

Q A
Branch? main
Bug fix? yes
New feature? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

Discussion in caddyserver/caddy#4130 brought this up.

There's a bit of a gotcha here, in that having two `?Field` headers will append each to the `Require` response matcher, so those header fields will only be set if _both_ are not present in the response. If one is present (e.g. `Link` is in the response) then neither are set.

Using separate header handlers solves this because they will use their own handlers, and therefore separate response matchers.
@dunglas dunglas merged commit d059b22 into api-platform:main Apr 24, 2021
@dunglas
Copy link
Member

dunglas commented Apr 24, 2021

Thanks @francislavoie!

@francislavoie francislavoie deleted the patch-1 branch April 24, 2021 07:23
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.

None yet

2 participants