setting custom header before redirect

284 views
Skip to first unread message

Larry Martell

unread,
May 31, 2016, 7:54:22 AM5/31/16
to django...@googlegroups.com
I need to set a custom header before I do a redirect. My code does this:

resp = redirect(uri)
resp['X-Capdata-Auth'] = 'authorized'
return resp

But when I look at the traffic with tcpdump, I do not see that header
value. What am I doing wrong here?

Larry Martell

unread,
May 31, 2016, 9:25:08 AM5/31/16
to django...@googlegroups.com
I traced the django code all the way through to when the response is
going out and I see this:

(Pdb) response._headers
{'x-capdata-auth': ('X-Capdata-Auth', 'authorized'), 'content-type':
('Content-Type', 'text/html; charset=utf-8'), 'location': ('Location',
'http://foo.bar.com:8000/workitem/12345'), 'vary': ('Vary', 'Cookie')}

Any one have any ideas as to why it doesn't seem to make it out?
Reply all
Reply to author
Forward
0 new messages