#28488: Django 1.11+ raises CSRF verification failed if settings.DEBUG is False 
and
an intermediate 404 page is requested
-------------------------------------+-------------------------------------
     Reporter:  Ruben Alves          |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  CSRF                 |                  Version:  master
     Severity:  Release blocker      |               Resolution:
     Keywords:  csrf failed          |             Triage Stage:  Accepted
  settings debug false production    |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Berker Peksag):

 > [...] so I'm beginning to think that my problem is different than this
 ticket.

 Turns out the hostname of the referer should be an exact match of
 `CSRF_COOKIE_DOMAIN` and in my case `is_same_domain('staging.python.org',
 'staging.python.org:9000')` returns `False`. I set `CSRF_TRUSTED_ORIGINS =
 ['staging.python.org']` and everything works fine now.

 Sorry for the noise!

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28488#comment:39>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.cedfbb59e9a7084e8fd786bce01886ac%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to