I'm curious to know what solution everyone has come up with for setting the
Content-Length headers for larger web applications. I'd rather not set it
for every single app / subapp response so I came up with this but it seems
pretty hacky. Thoughts?
def headersProcessor(h):
""" Set the content length and and content type of each request.
h : the handler for the requested url
return the response from the handler """
res = h()
web.header('Content-type', 'text/html; charset=utf-8')
web.header('Content-Length', len(res))
return res
app.add_processor(headersProcessor)
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/webpy/-/brb4RSGGqZMJ.
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/webpy?hl=en.