Set up the body reader based on CONTENT_LENGTH.
(self)
| 212 | self.headers.append(('CONTENT-LENGTH', value)) |
| 213 | |
| 214 | def set_body_reader(self): |
| 215 | """Set up the body reader based on CONTENT_LENGTH.""" |
| 216 | content_length = 0 |
| 217 | |
| 218 | # Get content length from vars |
| 219 | if 'CONTENT_LENGTH' in self.uwsgi_vars: |
| 220 | try: |
| 221 | content_length = max(int(self.uwsgi_vars['CONTENT_LENGTH']), 0) |
| 222 | except ValueError: |
| 223 | content_length = 0 |
| 224 | |
| 225 | self.body = Body(LengthReader(self.unreader, content_length)) |
| 226 | |
| 227 | def should_close(self): |
| 228 | """Determine if the connection should be closed after this request.""" |
no test coverage detected