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
Please forgive the question, as I'm sure this is just a misunderstanding I have about CORS or Hug middleware...
As I understand it, a request involving CORS is actually two requests:
A preflight request, using the OPTIONS method, where the server tells give us permission to make the 'real' request along with some headers.
The actual request.
I've been having a problem with duplicate requests in one of my Hug APIs. It seems like the built-in CORS middleware is adding the appropriate headers to the OPTIONS request, but then passing it on through to the API. The client then gets the OPTIONS response and sends the real requests, which results in the same operation being performed twice in my API.
It is my understanding that a CORS middleware should entirely handle the OPTIONS request, sending a response itself and not passing it on to any other middleware or the API.
Is there a reason the Hug CORS middlware doesn't do this, and is there an easy way to accomplish it?
The text was updated successfully, but these errors were encountered:
Please forgive the question, as I'm sure this is just a misunderstanding I have about CORS or Hug middleware...
As I understand it, a request involving CORS is actually two requests:
I've been having a problem with duplicate requests in one of my Hug APIs. It seems like the built-in CORS middleware is adding the appropriate headers to the OPTIONS request, but then passing it on through to the API. The client then gets the OPTIONS response and sends the real requests, which results in the same operation being performed twice in my API.
It is my understanding that a CORS middleware should entirely handle the OPTIONS request, sending a response itself and not passing it on to any other middleware or the API.
Is there a reason the Hug CORS middlware doesn't do this, and is there an easy way to accomplish it?
The text was updated successfully, but these errors were encountered: