-
Notifications
You must be signed in to change notification settings - Fork 34
Fix(django): Support ASGI requests #666
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
Conversation
CagriYonca
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
ced0341 to
1ea5eb7
Compare
pvital
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments.
- Migrate Django middleware to new-style Signed-off-by: Varsha GS <varsha.gs@ibm.com>
Signed-off-by: Varsha GS <varsha.gs@ibm.com>
Signed-off-by: Varsha GS <varsha.gs@ibm.com>
1ea5eb7 to
ad1861c
Compare
pvital
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me.
What's new?
Add support to ASGI requests.
Migrate the Django middleware to conform with the new style, from Django 2.0 onwards. By having a single entrypoint to the middleware, __call__, which is wrapped with sync_to_async just once for async requests, we avoid the issue where a ContextVar cannot be reset from a different context.
P.S.
ASGI support new in 3.0
response.headersnew in 3.2 (needed to extract custom headers)