Comment on Quick video demonstrating that lemmy.world sends every activity out twice
hoshikarakitaridia@lemmy.world 8 months agoIf the first one is OPTION, would that be a bug? Would the right design principle be to do it once per endpoint and then cache it for future requests?
I’m really curious cause I don’t know how this usually works…
scrubbles@poptalk.scrubbles.tech 8 months ago
That’s pretty standard with most libraries
Lemzlez@lemmy.world 8 months ago
I’ve never really seen this in (Java/Rust/PHP) backend personally, only in client-side JS (the CORS preflight).
It’s a security feature for browsers doing calls (checking the CORS headers before actually calling the endpoint), but for backends the only place it makes sense is if you’re implementing something like webhooks, to validate the (user submitted) endpoint.
hoshikarakitaridia@lemmy.world 8 months ago
Ok so my assumptions were right. Interesting…