(self)
| 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 |