Hey @gekctek
Sorry for the delayed response here (and on the other thread on the custom CORS headers). The HTTP gateways/BNs handle all pre-flight (OPTIONS) requests. This has mostly two reasons:
- Many canisters (e.g., the asset canister) do not handle pre-flight requests.
- It improves user experienced latency as the request is replied to immediately.
Until now, we have never really questioned this. However, now there are more and more developers building their own HTTP canisters and encountering this limitation.
We are currently discussing an alternative approach, where, for HTTP requests, the HTTP gateway would not reply directly to a pre-flight request, but would forward it to the canister and only inject its default if the canister fails to handle it (and potentially cache some of that for better user experience). It is on our list, but will take a few weeks until we will get to it.