Controller Callbacks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Won't Fix
|
Undecided
|
David Hadas |
Bug Description
A callback mechanism should be added to the controllers which could make our code simpler in middleware.
resp = controller_
This is offered as an alternative to hooking start_response which has several limitations - as well demonstrated in the Swift Middleware today.
In such a callback we can provide the middleware with the req and resp as parameters, which enables the middleware to easily extend core swift behaviour post request handling while it may have access to the env that was used to form the request as well as the full response as calculated by core swift. The middleware may modify the response as appropriate and return the modified response.
This is more powerful than hooking start_response (in which we have no env, req or resp but only the status and the headers of the response. This mechanism also does not require mingling with the body iterable (as we do today in some Swift Middleware) which would allow us to make some current middleware hooks simpler.
Changed in swift: | |
assignee: | nobody → David Hadas (david-hadas) |
Changed in swift: | |
status: | In Progress → Won't Fix |
Fix proposed to branch: master /review. openstack. org/34948
Review: https:/