Skip to content

Commit a47e2be

Browse files
authored
Merge pull request #36 from modern-python/fix/small-mop-up
fix(small-fixes): close 4 audit findings (0.8.5)
2 parents b95f357 + 335aee2 commit a47e2be

8 files changed

Lines changed: 1059 additions & 19 deletions

File tree

docs/middleware.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,22 @@ from httpware import Middleware, Next, before_request, after_response, on_error
147147
A sync `Middleware` is a structural protocol — any callable with the right signature satisfies it:
148148

149149
```python
150+
import logging
151+
150152
import httpx2
151153

152154
from httpware import Client
153155
from httpware.middleware import Next
154156

155157

158+
_LOGGER = logging.getLogger("myapp.logging_middleware")
159+
160+
156161
class LoggingMiddleware:
157162
def __call__(self, request: httpx2.Request, next: Next) -> httpx2.Response: # noqa: A002
158-
print(f"-> {request.method} {request.url}")
163+
_LOGGER.info("-> %s %s", request.method, request.url)
159164
response = next(request)
160-
print(f"<- {response.status_code}")
165+
_LOGGER.info("<- %s", response.status_code)
161166
return response
162167

163168

0 commit comments

Comments
 (0)