#7494 closed (fixed)
build_absolute_url method of the HttpRequest class fails with urls with : in their path
| Reported by: | Owned by: | RobotAdam | |
|---|---|---|---|
| Component: | HTTP handling | Version: | dev |
| Severity: | Keywords: | aug22sprint | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | yes |
| Easy pickings: | no | UI/UX: | no |
Description
When build_absolute_url is called for a location that should contain a ":" character in it's path it fails to add the "http://www.example.com" part.
This is because off line 76 of django/http/init.py where "if not ':' in location:" is used to check if the location is already absolute.
According to http://www.faqs.org/rfcs/rfc1738.html it is perfectly valid to have a ":" in the path part of a HTTP url.
Attachments (2)
Change History (10)
by , 17 years ago
| Attachment: | fix_absolute_url_check_in_get_absolute_url.diff added |
|---|
comment:1 by , 17 years ago
| Component: | Uncategorized → HTTP handling |
|---|
comment:2 by , 17 years ago
| milestone: | → 1.0 |
|---|---|
| Needs tests: | set |
| Owner: | changed from to |
| Patch needs improvement: | set |
| Status: | new → assigned |
The https:// shouldn't be hard coded in. This looks like it is a bug though.
comment:3 by , 17 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:4 by , 17 years ago
| Owner: | removed |
|---|---|
| Status: | assigned → new |
by , 17 years ago
| Attachment: | fix_absolute_url_check_with_tests.diff added |
|---|
Updated patch including tests
comment:5 by , 17 years ago
| Keywords: | aug22sprint added |
|---|---|
| Owner: | set to |
| Status: | new → assigned |
The "https?" in the regexp is correct with the question mark. I've updated the patch with tests that confirm it.
comment:6 by , 17 years ago
| Needs tests: | unset |
|---|
comment:7 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Patch that fixes the problem