(
self, name: str, source: Dict[str, List[bytes]], strip: bool = True
)
| 593 | return args[-1] |
| 594 | |
| 595 | def _get_arguments( |
| 596 | self, name: str, source: Dict[str, List[bytes]], strip: bool = True |
| 597 | ) -> List[str]: |
| 598 | values = [] |
| 599 | for v in source.get(name, []): |
| 600 | s = self.decode_argument(v, name=name) |
| 601 | if isinstance(s, unicode_type): |
| 602 | # Get rid of any weird control chars (unless decoding gave |
| 603 | # us bytes, in which case leave it alone) |
| 604 | s = RequestHandler._remove_control_chars_regex.sub(" ", s) |
| 605 | if strip: |
| 606 | s = s.strip() |
| 607 | values.append(s) |
| 608 | return values |
| 609 | |
| 610 | def decode_argument(self, value: bytes, name: Optional[str] = None) -> str: |
| 611 | """Decodes an argument from the request. |
no test coverage detected