-
-
Notifications
You must be signed in to change notification settings - Fork 536
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
Fix double firing of check_request_enabled
#228
Comments
Correct me if I'm wrong, but I think it already executes just once. Before |
The signal fires each time django-cors-headers/src/corsheaders/middleware.py Lines 183 to 185 in eb278fc
The django-cors-headers/src/corsheaders/middleware.py Lines 178 to 181 in eb278fc
The django-cors-headers/src/corsheaders/middleware.py Lines 121 to 123 in eb278fc
Finally there's a second call to django-cors-headers/src/corsheaders/middleware.py Lines 140 to 144 in eb278fc
So technically For the double firing to happen |
The
check_request_enabled
signal can fire twice duringprocess_response
, but really we should only do it once. Handlers could be expensive, e.g. doing database queries, and there's no reason they should be expected to cache their results.Reported by @MarkusH.
The text was updated successfully, but these errors were encountered: