(
self, name: str, source: Dict[str, List[bytes]], strip: bool = True
)
| 542 | return args[-1] |
| 543 | |
| 544 | def _get_arguments( |
| 545 | self, name: str, source: Dict[str, List[bytes]], strip: bool = True |
| 546 | ) -> List[str]: |
| 547 | values = [] |
| 548 | for v in source.get(name, []): |
| 549 | s = self.decode_argument(v, name=name) |
| 550 | if isinstance(s, unicode_type): |
| 551 | # Get rid of any weird control chars (unless decoding gave |
| 552 | # us bytes, in which case leave it alone) |
| 553 | s = RequestHandler._remove_control_chars_regex.sub(" ", s) |
| 554 | if strip: |
| 555 | s = s.strip() |
| 556 | values.append(s) |
| 557 | return values |
| 558 | |
| 559 | def decode_argument(self, value: bytes, name: Optional[str] = None) -> str: |
| 560 | """Decodes an argument from the request. |
no test coverage detected