Starlette introduced some new changes to how the `root_path` is handled,
which broke our `ReverseProxied` example and test.
This PR fixes both and adds documentation on how to run behind a proxy.
Fixes#1820.
Correct error handling in response to CORS.
Changes proposed in this pull request:
- Add a MiddlewarePosition before Exception handling so CORS is always
returned
- Add ServerError Middleware to handle unhandled errors between the
ServerError- and ExceptionMiddleware
- Update corresponding docs
---------
Co-authored-by: Robbe Sneyders <robbe.sneyders@ml6.eu>
Continues on the work of #1077 by moving the test fixtures into the
`secure_endpoint` fixture and adding a test for it in
`test_secure_api.py`.
The test will check whether an api key in the query will not lead to an
error when `strict_validation` is enabled.
This PR refactors our tests to prepare the activation of our tests for
our AsyncApp.
The separate commits are atomic, which can be useful for reviewing.
---------
Co-authored-by: Ruwann <ruwanlambrichts@gmail.com>