MCPcopy
hub / github.com/django/django / get_port

Method get_port

django/http/request.py:212–218  ·  view source on GitHub ↗

Return the port number for the request as a string.

(self)

Source from the content-addressed store, hash-verified

210 raise DisallowedHost(msg)
211
212 def get_port(self):
213 """Return the port number for the request as a string."""
214 if settings.USE_X_FORWARDED_PORT and "HTTP_X_FORWARDED_PORT" in self.META:
215 port = self.META["HTTP_X_FORWARDED_PORT"]
216 else:
217 port = self.META["SERVER_PORT"]
218 return str(port)
219
220 def get_full_path(self, force_append_slash=False):
221 return self._get_full_path(self.path, force_append_slash)

Callers 4

_get_raw_hostMethod · 0.95
test_get_portMethod · 0.95
_check_refererMethod · 0.80

Calls

no outgoing calls

Tested by 2

test_get_portMethod · 0.76