| 1985 | return lambda *args, **kwargs: method(self, *args, **kwargs) |
| 1986 | |
| 1987 | def _clear_representation_headers(self) -> None: |
| 1988 | # 304 responses should not contain representation metadata |
| 1989 | # headers (defined in |
| 1990 | # https://tools.ietf.org/html/rfc7231#section-3.1) |
| 1991 | # not explicitly allowed by |
| 1992 | # https://tools.ietf.org/html/rfc7232#section-4.1 |
| 1993 | headers = ["Content-Encoding", "Content-Language", "Content-Type"] |
| 1994 | for h in headers: |
| 1995 | self.clear_header(h) |
| 1996 | |
| 1997 | |
| 1998 | _RequestHandlerType = TypeVar("_RequestHandlerType", bound=RequestHandler) |