jamesturk/django-honeypot

Content type field check case sensitivity

justinvelluppillai opened this issue · 2 comments

The middleware content type check key and types are hardcoded and therefore don't allow honeypotting some pages they should. Perhaps the keys and types could be added as settings to override the defaults:

_HTML_TYPES = ('text/html', 'application/xhtml+xml')

content_type = response['Content-Type'].split(';')[0]

I believe response['Content-Type'] isn't working for me because my header is response['content-type'] or similar.

Can you provide a test case for this? Headers aren't case-sensitive in Django's Request objects, so I'd imagine the issue is something else.

Yes you're right, I have wrongly diagnosed this issue. I will investigate further and close this for now.