From 55dc5ff813106c579378a55a3cbff07f9c6689df Mon Sep 17 00:00:00 2001 From: CharlieSeastar <49227833+CharlieSeastar@users.noreply.github.com> Date: Wed, 6 Nov 2024 09:04:56 +0800 Subject: [PATCH] Fix TestClient for fastapi cause the req.client None error (#355) --- CHANGELOG.md | 11 +++++++++++ skywalking/plugins/sw_fastapi.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8aaedf01..381dc5d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ ## Change Logs +### 1.2.0 + +- Feature: + - Drop support for 3.7 (#356) + +- Fixes: + - Fix: user/password replacement is not allowed for relative URLs (#349) + - Fix pulsar client does not support init arguments other than service_url (#351) + - Fix outdated make dev-fix rule in CodeStyle.md (#350) + - Fix TestClient for fastapi cause the req.client None error (#355) + ### 1.1.0 - Feature: diff --git a/skywalking/plugins/sw_fastapi.py b/skywalking/plugins/sw_fastapi.py index 45ce504f..9acba507 100644 --- a/skywalking/plugins/sw_fastapi.py +++ b/skywalking/plugins/sw_fastapi.py @@ -56,7 +56,7 @@ async def create_span(self, method, scope, req, send, receive): with span: span.layer = Layer.Http span.component = Component.FastAPI - span.peer = f'{req.client.host}:{req.client.port}' + span.peer = f'{req.client.host}:{req.client.port}' if req.client else 'unknown' span.tag(TagHttpMethod(method)) span.tag(TagHttpURL(str(req.url).split('?')[0])) if config.plugin_fastapi_collect_http_params and req.query_params: