Closed Anton-2 closed 5 months ago
I don't see any issue with adding CORS and OPTIONS request support; they'll be useful for sure!
We now recommend using https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer instead, and would like to discontinue supporting this library. Would that library meet your needs? Maybe it already addresses what you would like here?
Thanks Dan, and yes, CircuitPython_HTTPServer meets my needs.
When developing a web application connecting to CircuitPython_WSGI, it's practical to have the web server on the host, and make query to Adafruit_CircuitPython_WSGI from the web application.
In such a scenario, non GET requests are forbidden at the browser level if we don't handle CORS and OPTIONS requests.
I've made a few modifications to handle it unconditionally (allowing all types of requests from any host). Is there any security consideration not to do this ?
I'll post a PR for this shortly.