(self, environ, start_response)
| 118 | self.load_middleware() |
| 119 | |
| 120 | def __call__(self, environ, start_response): |
| 121 | set_script_prefix(get_script_name(environ)) |
| 122 | signals.request_started.send(sender=self.__class__, environ=environ) |
| 123 | request = self.request_class(environ) |
| 124 | response = self.get_response(request) |
| 125 | |
| 126 | response._handler_class = self.__class__ |
| 127 | |
| 128 | status = "%d %s" % (response.status_code, response.reason_phrase) |
| 129 | response_headers = [ |
| 130 | *response.items(), |
| 131 | *(("Set-Cookie", c.OutputString()) for c in response.cookies.values()), |
| 132 | ] |
| 133 | start_response(status, response_headers) |
| 134 | if getattr(response, "file_to_stream", None) is not None and environ.get( |
| 135 | "wsgi.file_wrapper" |
| 136 | ): |
| 137 | # If `wsgi.file_wrapper` is used the WSGI server does not call |
| 138 | # .close on the response, but on the file wrapper. Patch it to use |
| 139 | # response.close instead which takes care of closing all files. |
| 140 | response.file_to_stream.close = response.close |
| 141 | response = environ["wsgi.file_wrapper"]( |
| 142 | response.file_to_stream, response.block_size |
| 143 | ) |
| 144 | return response |
| 145 | |
| 146 | |
| 147 | def get_path_info(environ): |
nothing calls this directly
no test coverage detected