(response)
| 235 | def after_request(self, func: _t.Callable[[], _t.Any]): |
| 236 | @self.server.after_request |
| 237 | async def _after(response): |
| 238 | if func is not None: |
| 239 | result = func() |
| 240 | if inspect.iscoroutine(result): # Allow async hooks |
| 241 | await result |
| 242 | return response |
| 243 | |
| 244 | def has_request_context(self) -> bool: |
| 245 | if has_request_context is None: |