#Jed
1 messages ยท Page 1 of 1 (latest)
I just found this...
I'm still trying to wrap my head around this a bit. Is your browser having some issue loading our Checkout pages as a result of this issue? Or are you seeing some other weird behavior?
I'm returning a 302 redirect to the url in the session response
making a get request from axios to my server, the server httpresponse header is 302 and the Location is the URI returned by the stripe api call
Ah so your 302 redirect is getting blocked because of CORS?
yes
but, i believe it may be related to the fact that the fragment portion of the uri is not being included in the browsers get request to stripe
technically that shouldn't be related to cors though....
DNS is Azure
I am admittedly not that familiar with how CORS may affect this. Can try to look in to this though. What is the exact error that the browser is giving you?
Access to XMLHttpRequest at 'https://checkout.mycustomdomain.com/c/pay/cs_test_a1IPCrr45bDxEO4QguKHLs8oshzYoL8z5B180MsAIXQSN0g2i80lSJA2u0#fidkdWxOYHwnPyd1blpxYHZxWjA0QDxiVmdEM1dKdHZdZFFOUm0ySW.......bHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl' (redirected from 'https://api.mycustomdomain.com/api/sample_purchase') from origin 'https://mycustomdomain.com has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
i replaced my actual address and the session key w/ dummy data
could it have anything to do w/ the Authorization header on the initial request?
I'm using a bearer token w/ an unrelated identity provider
Hi ๐
Let me check a few resources to see if we've run into this
And just to be clear, how are you triggering the redirect? Is your server-side code is performing this action?
yes, azure functions v4
req.HttpContext.Response.Headers.Add("Access-Control-Allow-Origin", "*");
req.HttpContext.Response.Headers.Add("Location", session.Url);
return new StatusCodeResult(303);
.net core
Hmmm ... ๐ค
I'm looking around and I'm not seeing ay clear examples specific to your tech stack. This SO question appears kind of close but it's for Node and I don't think it's quite the same. Still some of the info in the answer and comments may be helpful: https://stackoverflow.com/questions/68630229/stripe-checkout-example-running-into-cors-error-from-localhost
๐