itty-cors
itty-cors copied to clipboard
Returns CORS error after successful connection
Thanks for this great library and for itty, in general. There is a strange bug we are running into with Itty cors, which we cant figure out. The 1st time a browser client tries to connect to the worker, the CORS is fine and they can connect. After a few minutes, a subsequent request, will throw a CORS error, i.e. "has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. " However, as we fetch in the background after a failure, the next connection attempt will succeed. What I don't understand is why there is CORS error after the first connection is successful, why would a subsequent connect attempt a few minutes later fail due to CORS error and then succeed after another attempt?