| 1817 | return lambda *args, **kwargs: method(self, *args, **kwargs) |
| 1818 | |
| 1819 | def _clear_representation_headers(self) -> None: |
| 1820 | # 304 responses should not contain representation metadata |
| 1821 | # headers (defined in |
| 1822 | # https://tools.ietf.org/html/rfc7231#section-3.1) |
| 1823 | # not explicitly allowed by |
| 1824 | # https://tools.ietf.org/html/rfc7232#section-4.1 |
| 1825 | headers = ["Content-Encoding", "Content-Language", "Content-Type"] |
| 1826 | for h in headers: |
| 1827 | self.clear_header(h) |
| 1828 | |
| 1829 | |
| 1830 | _RequestHandlerType = TypeVar("_RequestHandlerType", bound=RequestHandler) |