Christian wrote:
> class ExpireJSONFilter(object):
> rh = cherrypy.response.headers
> ct = rh.get('Content-type', None)
> # not sure what exact content-type TG sets for JSON
> # don't stomp on an already-set 'Expires' header
> if ct == 'application/json' and 'Expires' not in rh:
> rh['Expires'] = '0'
Bah. ...
class ExpireJSONFilter(object):
def before_finalize(self):
rh = cherrypy.response.headers
ct = rh.get('Content-type', None)
# not sure what exact content-type TG sets for JSON
# don't stomp on an already-set 'Expires' header
if ct == 'application/json' and 'Expires' not in rh:
rh['Expires'] = '0'
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---