Controller Callbacks

Bug #1195861 reported by David Hadas
6
This bug affects 1 person
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_callback(req, resp)

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)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/34948

Changed in swift:
status: New → In Progress
Changed in swift:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.