4 ms·
Microservices largely break the standard HTTP patterns anyway. E.g. you are supposed to redirect after a POST request so that users can't double submit a form,
by Alex3917 12y ago
Microservices largely break the standard HTTP patterns anyway. E.g. you are supposed to redirect after a POST request so that users can't double submit a form, but if you're hosting your frontend on a CDN then this isn't possible because the CORS spec prevents browsers from honoring redirect responses except for after GET and HEAD requests.
Incidentally, you are supposed to be allowed to redirect in response to GET requests, but if you use JWT auth then you can't even do this because the non-standard header forces a preflight request, and CORS requests with preflight aren't allowed to redirect at all.
I don't even understand how it's supposedly secure to pass back JSON with a URL for your promise to trigger a redirect, but it's insecure to pass your browser a 3XX response to do the same thing automatically.
- dragonwriter 12y ago> Microservices largely break the standard HTTP patterns anyway. There's a difference between violating common patterns and breaking the specified semantics of the standard. > E.g. you are supposed to redirect after a POST request so that users can't double submit a form That's a common practice, but not a requirement of the HTTP standard the way that GET methods not having semantically-significant request bodies is.
- duaneb 12y agoTo be fair, CORS is not a part of HTTP. If you're talking to your microservice with a browser, you've misunderstood the point of microservices.