-
Notifications
You must be signed in to change notification settings - Fork 269
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
Add directive to undo HEAD to GET mapping when output filters exist. #2
Comments
I have a need for access to the original request method when redirecting to resources on Amazon S3 using query string authentication. My current work around is set the original request method in a different environment variable:
Then fix up the wsgi environment in my app. The only problem I've run into is when combining this with an internal redirect, as mod_wsgi sets |
Can you try snapshot of mod_wsgi 4.3.0. https://github.com/GrahamDumpleton/mod_wsgi/archive/feature/4.3.0.zip Set the directive: WSGIMapHEADToGET Off This can be at VirtualHost scope, or more specific scope such as a Location or Directory block. Just understand the consequences of doing this if an Apache output filter is present that expects to see the response content, even for a HEAD, to ensure that they match what would be returned for a GET request. If they don't match because of optimisations, then it can confuse caching systems. |
Released in 4.3.0. |
If Apache output filters are detected that could care about seeing the actual content for a HEAD, the mod_wsgi will remap a HEAD request to a GET request. This is to ensure that output filters will generate the same response headers where they are generating some based on the actual content. If this isn't done it is technically breaking the HTTP specification that response headers for GET and HEAD should be the same.
Even though this is the case, provide a directive to disable this auto mapping for those people who believe that they aren't using any Apache output filters where this would matter.
See:
Original commentary about the GET vs HEAD problem at:
The text was updated successfully, but these errors were encountered: