Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # I believe a better way to set cookies (and replacing the lines above) is:
- status = '%s %s' % (response.status_code, status_text) # Still unused...
- self.set_status(response.status_code)
- for h in response.items() :
- self.set_header(h[0], h[1])
- # Set the cookies using the tornado function for that purpose.
- for cookie_key,cookie_value in response.cookies.iteritems() :
- self.set_cookie(cookie_key, cookie_value.value, **dict(cookie_value.iteritems()))
- self.write(response.content)
- self.finish()
Add Comment
Please, Sign In to add comment