Opened 13 years ago

Last modified 11 years ago

#2782 closed defect

mod_python's request.META["SERVER_PORT"] is always set to 0 — at Initial Version

Reported by: anonymous Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Seems I have found small bug in core/handlers/

Namely request.META [ "SERVER_PORT" ] under mod_python is always set to 0.

This is because its set to self._req.server.port in line

mod_python's docs say


Integer. TCP/IP port number. Same as CGI SERVER_PORT. This member

appears to be 0 on Apache 2.0, look at req.connection.local_addr
instead (Read-Only

So I think it should be:
'SERVER_PORT': str(self._req.connection.local_addr [ 1 ]),

Because self._req.connection.local_addr [ 1 ] is an integer I think it
should be string as other headers are.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top