[Wellbore DDMS] Allow OPTIONS (preflight) requests
We have an Angular application that creates trajectories using
/api/os-wellbore-ddms/ddms/v2/trajectories. But before the POST request is sent, the browser applies CORS principles and sends a preflight (
OPTIONS) request to the service which rejects it with a
405 Method Not Allowed error. The
OPTIONS method doesn't seem to be allowed by the Wellbore DDMS service.
An easy way to test this:
curl -X OPTIONS https://<host>/api/os-wellbore-ddms/ddms/v2/trajectories -H 'Origin: http://localhost:8000' -H 'Access-Control-Request-Method: POST'
Would it be possible to allow the
OPTIONS method? With FastAPI it seems like it can be done with the
allow_methods parameter of the
add_middleware function, as documented on this page.
Thank you in advance.