MCPcopy
hub / github.com/django/django / get_environ

Method get_environ

django/core/servers/basehttp.py:208–217  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

206 )
207
208 def get_environ(self):
209 # Strip all headers with underscores in the name before constructing
210 # the WSGI environ. This prevents header-spoofing based on ambiguity
211 # between underscores and dashes both normalized to underscores in WSGI
212 # env vars. Nginx and Apache 2.4+ both do this as well.
213 for k in self.headers:
214 if "_" in k:
215 del self.headers[k]
216
217 return super().get_environ()
218
219 def handle(self):
220 self.close_connection = True

Callers 1

handle_one_requestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected