Skip to content

Commit

Permalink
Merge pull request #8 from bybatkhuu:develop
Browse files Browse the repository at this point in the history
🐛 Fix URL path escaping in RequestHTTPInfoMiddleware.
  • Loading branch information
bybatkhuu authored Dec 15, 2023
2 parents 4f7634e + e6e950d commit 384cef1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions beans_logging_fastapi/_middlewares.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ async def dispatch(self, request: Request, call_next: Callable) -> Response:
_http_info["url_path"] = _http_info["url_path"].replace("{", "{{")
if "}" in _http_info["url_path"]:
_http_info["url_path"] = _http_info["url_path"].replace("}", "}}")
if "<" in _http_info["url_path"]:
_http_info["url_path"] = _http_info["url_path"].replace("<", "\<")
if request.url.query:
_http_info["url_path"] = f"{request.url.path}?{request.url.query}"

Expand Down

0 comments on commit 384cef1

Please sign in to comment.