Opened 18 years ago
Closed 18 years ago
#4986 closed (fixed)
get_host should fall back to building from SERVER_NAME/PORT if HTTP_HOST doesn't exist
| Reported by: | Chris Beaven | Owned by: | nobody |
|---|---|---|---|
| Component: | HTTP handling | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | smileychris+django@… | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The problem is that get_host currently relies on HTTP_HOST environ variable which may not exist.
Using a section of PEP333 as my muse, I rewrote get_host to fall back to creating the host based on SERVER_NAME and SERVER_PORT.
Attachments (1)
Change History (7)
by , 18 years ago
| Attachment: | get_host.patch added |
|---|
comment:1 by , 18 years ago
comment:2 by , 18 years ago
| Cc: | added |
|---|---|
| Triage Stage: | Unreviewed → Ready for checkin |
comment:3 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:4 by , 18 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
The fix doesn't seem to be quite right as the value from HTTP_X_FORWARDED_HOST is now never used and is always overwritten.
comment:6 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
Note:
See TracTickets
for help on using tickets.
When this is applied, #4951 can be upgraded to ready for checkin.