juno.redirect clears headers?

5 views
Skip to first unread message

Ferry

unread,
May 16, 2009, 11:13:14 AM5/16/09
to juno-framework
I'm fiddling around a bit with custom headers in Juno responses. I'm
using the juno.header() method for this. If I redirect using
juno.redirect() after setting a custom header, Juno clears out the
custom headers as can be seen here:

def redirect(url, code=302):
status(code)
# clear the response headers and add the location header
_response.config['headers'] = { 'Location': url }
return _response

What is the reason Juno clears the headers? I couldn't find anything
requiring that in RFC 2616. If I replace the line with

_response.config['headers']['Location'] = url

the custom headers are sent correctly. The browser also properly
redirects to the url I specified.
Reply all
Reply to author
Forward
0 new messages