Replies: 2 comments 14 replies
-
You're suggesting we just drop that part entirely? I agree, it seems like specifying This feels like major bump territory, right? |
Beta Was this translation helpful? Give feedback.
12 replies
-
@sondrelg |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, setting the
Access-Control-Expose-Headers
response header with this middleware feels a bit wrong. There a couple of reasons.At the moment the header is always set, even for non-CORS requests. This doesn't cause any harm but feels superfluous. It should probably be used only in context of a CORS protocol.
If you want to allow propagation of correlation ID from the downstream services/components, you have to handle CORS in its entirety, especially responding with
Access-Control-Allow-Headers
to preflight requests to actually allow sending request headers with correlation ID set. This is typically done with a specialized middleware like Starlette's CORS middleware which has its own means of setting the expose headers. If you use both middlewares together theAccess-Control-Expose-Headers
header is duplicated in the response. This again is strictly not a problem (according to RFC 9110) but again feels superfluous especially when you need to expose multiple headers and use CORS middleware to handle this.What do you think @JonasKs @sondrelg ?
Beta Was this translation helpful? Give feedback.
All reactions