4 Commits

Author SHA1 Message Date
Niels Dewulf
0082d7ad33 Fix CORS headers not set on exceptions (#1821)
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>
2023-12-01 00:04:46 +01:00
Robbe Sneyders
14e02fa97f Add interface to add WSGI middleware (#1814)
As discussed in #1807.

Allowing the injection of WSGI middleware can enable easier migration
from Connexion 2 to Connexion 3. The use cases are limited though, as
this will only work for middleware that can work at the end of the
middleware stack.
2023-11-19 23:46:21 +01:00
Aurélien Joga
095ae897a5 Fix middleware doc example (#1796)
I'm starting to use the project with the newly release 3 version.


70084bcc4c/docs/middleware.rst (L115-L120)

It seems this example is not correct. 

1. missing import for SecurityMiddleware
2. `ConnexionMiddleware.default_middlewares` is a list of classes, not
class instances: the filtering never happen.
2023-11-08 23:17:30 +01:00
Robbe Sneyders
fcd4e66ec6 Add middleware documentation (#1706)
Contributes towards https://github.com/spec-first/connexion/issues/1531

This PR adds a documentation page on middleware.
2023-06-08 00:15:28 +02:00