Skip to content

fix: handle HEAD requests like GET in generic_views #2015

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

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

Conversation

janheini
Copy link

As mentioned in #1956, the generic views break when handling a HEAD request, since data from request.GET is only added if request.method == "GET". Since request.GET can also be used when the method is HEAD we can just treat them the same.

The issue can be reproduced simply by changing the request method in test_generic_views.py and running the tests. I have added this as a new test case.

Fixes #1956

I'm open for feedback if you prefer a different solution.

Thank you!
Jan

HEAD requests caused an exception before. Handle them like GET requests.

Fixes django-haystack#1956
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.

Generic view does not support the "HEAD" method.
1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy