pigeon.middleware¶
Subpackages¶
Submodules¶
Package Contents¶
- pigeon.middleware.preprocess(raw: bytes) pigeon.http.HTTPResponse | pigeon.http.HTTPRequest ¶
Tries to parse the raw request and checks whether the request is valid. If the request is invalid or could not be parsed correctly, an http error response will be returned.
- pigeon.middleware.process(message: pigeon.http.message.HTTPMessage) pigeon.http.HTTPResponse ¶
Gathers the response from the application logic.
- pigeon.middleware.postprocess(message: pigeon.http.message.HTTPMessage, response: pigeon.http.HTTPResponse) pigeon.http.HTTPResponse ¶
Modifies some components of the response such as headers to fit in with server-side policies (e.g. CORS).