You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It is sometimes necessary to modify the Access-Control-Expose-Headers within the request cycle. As an example, a developer might need to set the Content-Disposition and Content-Type when returning a file from an API so that it has a name, for e.g.:
We came across a bug in production with the way Django-GUID implements the EXPOSE_HEADER setting, in that on the outgoing request processing, it overrides any setting set by the user in the request flow, because it replaces the already set Access-Control-Expose-Headers rather than being additive.
To Reproduce
Create a view in Django
Set "Access-Control-Expose-Headers" to some value within the view
Set Django GUID setting "EXPOSE_HEADER" to "True"
Make an API request to the view, look at the request, and see that the developer set value has been overwritten.
Full stack trace
N/A
The text was updated successfully, but these errors were encountered:
I’d recommend turning the setting off, and configure these settings in your Django CORS middleware instead. 😊 PR to remove the setting and updating docs welcome, of course!
Thank you 😊 I won't be able to look until Saturday/Sunday, but I'll make sure we'll get a release out soon enough. In the meantime, I'd recommend just fixing CORS manually and not enabling that setting 😊
Describe the bug
It is sometimes necessary to modify the Access-Control-Expose-Headers within the request cycle. As an example, a developer might need to set the Content-Disposition and Content-Type when returning a file from an API so that it has a name, for e.g.:
We came across a bug in production with the way Django-GUID implements the EXPOSE_HEADER setting, in that on the outgoing request processing, it overrides any setting set by the user in the request flow, because it replaces the already set Access-Control-Expose-Headers rather than being additive.
To Reproduce
Full stack trace
N/A
The text was updated successfully, but these errors were encountered: