I am facing some difficulties in implementing CORS in my application. I am using this solution (https://github.com/harel/nameko-cors) and as expected the OPTIONS request responds with all the * attributes, however when the second request arrives on the actual endpoint method it receives a 405, previously OPTIONS releases all the methods. can anybody help me?
I realize this is late and it probably won’t be very helpful because it’s obvious, but, in case anyone else runs into this…
If two paths are defined that overlap, it can be less than obvious that the reported Method Not Found is actually true. For example, I had a POST /service
and a GET /service/<string:id>
; in my calls to the service, I was unwittingly POSTing to /service/get_key (get_key was the name of the function). So in fact, that path was matching the GET path and providing it was a id
of get_key
but sending it as a POST; which really was not allowed. Several hours were wasted before I saw the mistake and removed the /get_key
from the POST call.
Hope that saves someone some time.
-Eric