Opened 14 years ago
Closed 14 years ago
#17067 closed Bug (fixed)
REMOTE_ADDR should be set to 127.0.0.1 in the test client environment
| Reported by: | Jim Dalton | Owned by: | nobody |
|---|---|---|---|
| Component: | Testing framework | Version: | 1.3 |
| Severity: | Release blocker | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Attachments (1)
Change History (4)
by , 14 years ago
| Attachment: | restore_remote_addr_to_test_client_env.diff added |
|---|
comment:1 by , 14 years ago
| Has patch: | set |
|---|
comment:2 by , 14 years ago
| Severity: | Normal → Release blocker |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
| Type: | Uncategorized → Bug |
Indeed, it's a regression => release blocker.
The root of the problem is that #8551 and #16705 have been resolved with different mindsets: "do something reasonable for most cases" vs. "follow the reference documentation strictly".
I'd prefer following a solid reference before adding / removing more variables to / from the default environment of the test client. However, I didn't find a good one.
The current reference is PEP 3333; I admit it isn't totally realistic. Looking at RFC 3875 (CGI 1.1, http://www.ietf.org/rfc/rfc3875), most of the meta-variables defined there are irrelevant, so it isn't a good starting point either.
Thus, I think that the best fix is to put back REMOTE_ADDR in the default environment, with a comment saying "not defined by PEP 3333, but provided by most webservers, see #8551"
Added a patch that restores the environment variable. I also added tests to prevent this kind of regression in the future.