Fixed #7494 -- Fixed build_absolute_url() for some types of (uncommon) URLs.

Patch from tom@almostobsolete.net and RobotAdam.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8490 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2008-08-23 17:28:12 +00:00
parent 3dd69a965b
commit 646f2f6101
2 changed files with 12 additions and 1 deletions

View file

@ -36,4 +36,12 @@ META:{}>
>>> from django.http import parse_cookie
>>> parse_cookie('invalid:key=true')
{}
>>> request = HttpRequest()
>>> print request.build_absolute_uri(location="https://www.example.com/asdf")
https://www.example.com/asdf
>>> request.get_host = lambda: 'www.example.com'
>>> request.path = ''
>>> print request.build_absolute_uri(location="/path/with:colons")
http://www.example.com/path/with:colons
"""