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

Avoid modifying method on HEAD requests #353

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bltavares
Copy link

Traefik sends a forward auth request for every request, including HEAD methods, in order to validate if a request can continue.

Due to Go HTTP client being strict to the HTTP SPEC, the response of a HEAD does not include a body, while Traefik expects a validation response to be embedded, causing errors.

To mitigate this, when a X-Forwarded-Method is set as HEAD, we'll avoid modifying the HTTP Method response in order to send a body back, allowing head requests to by validated.

This is necessary even if an allow rule is set, otherwhise it will fail as well.

Mitagates: #156

Traefik sends a forward auth request for every request, including HEAD methods, in order to validate if a request can continue.

Due to Go HTTP client being strict to the HTTP SPEC, the response of a HEAD does not include a body, while Traefik expects a validation response to be embedded, causing errors.

To mitigate this, when a X-Forwarded-Method is set as HEAD, we'll avoid modifying the HTTP Method response in order to send a body back, allowing head requests to by validated.

This is necessary even if an allow rule is set, otherwhise it will fail as well.

Mitagates:  thomseddon#156
@rsch136
Copy link

rsch136 commented Sep 21, 2024

Hi! I am facing exactly the problem described in #156. Does anything speak against merging this PR?

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