relative URLs in redirects

73 views
Skip to first unread message

msoulier

unread,
Oct 31, 2013, 11:44:33 AM10/31/13
to django...@googlegroups.com
Hi,

If I return an HttpRedirect() with a relative URL in it, I notice that Django fully qualifies the redirect with a hostname and scheme.

ie.

Location /foo/bar/

goes to


Is there a reason to fully qualify like this? I've found relative URLs much more portable in the past, and they work through proxies, make no assumptions about SSL on or off, etc.

Thanks,
Mike

Tom Evans

unread,
Oct 31, 2013, 12:56:11 PM10/31/13
to django...@googlegroups.com
The Location header must always be a fully qualified URI, according to
every single version of the HTTP RFC from RFC 1945 onwards.

Cheers

Tom

msoulier

unread,
Nov 1, 2013, 11:08:18 AM11/1/13
to django...@googlegroups.com, teva...@googlemail.com
Damn. Missed that. Thanks.
Reply all
Reply to author
Forward
0 new messages