(self)
| 208 | self.do_REQUEST() |
| 209 | |
| 210 | def do_POST(self): |
| 211 | length = int(self.headers.get("Content-length", 0)) |
| 212 | if length: |
| 213 | data = self.rfile.read(length) |
| 214 | data = unquote_plus(data.decode(UNICODE_ENCODING, "ignore")) |
| 215 | self.data = data |
| 216 | elif self.headers.get("Transfer-encoding") == "chunked": |
| 217 | data, line = b"", b"" |
| 218 | count = 0 |
| 219 | |
| 220 | while True: |
| 221 | line += self.rfile.read(1) |
| 222 | if line.endswith(b'\n'): |
| 223 | if count % 2 == 1: |
| 224 | current = line.rstrip(b"\r\n") |
| 225 | if not current: |
| 226 | break |
| 227 | else: |
| 228 | data += current |
| 229 | |
| 230 | count += 1 |
| 231 | line = b"" |
| 232 | |
| 233 | self.data = data.decode(UNICODE_ENCODING, "ignore") |
| 234 | |
| 235 | self.do_REQUEST() |
| 236 | |
| 237 | def log_message(self, format, *args): |
| 238 | return |
no test coverage detected