#36399: Missing cookies when using ASGI and HTTP/2
-------------------------------------+-------------------------------------
     Reporter:  Ingmar Stein         |                    Owner:
                                     |  JaeHyuckSa
         Type:  New feature          |                   Status:  assigned
    Component:  HTTP handling        |                  Version:  5.2
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Carlton Gibson):

 This doesn't qualify for a backport but you can easily do yourself by
 adjusting your `asgi.py` file.

 Something like...


 {{{
 # asgi.py

 import os

 # Restore when removing ASGIRequest backport.
 # from django.core.asgi import get_asgi_application

 # Imports for Backport
 import django
 from django.core.handlers.asgi import ASGIHandler

 # https://code.djangoproject.com/ticket/36399
 assert django.VERSION < (6,0), "Remove ASGIRequest backport."

 # Inline ASGIRequest here.
 # You can copy/paste the whole class or just override __init__. Up to you.

 # Subclass ASGIHandler to use your request class.
 class BackportASGIHandler(ASGIHandler):
     request_class = # Your backported request class.

 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "your_app.settings")

 # Restore when removing ASGIRequest backport.
 # application = get_asgi_application()

 django.setup(set_prefix=False)

 application = BackportASGIHandler()

 }}}

 That's just a sketch. Adjust to your needs.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36399#comment:11>
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 view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070196e78c3aa7-a9b82bf5-738e-42d3-92e9-c6ce1a4024bc-000000%40eu-central-1.amazonses.com.

Reply via email to