Skip to content

Commit 55dc5ff

Browse files
Fix TestClient for fastapi cause the req.client None error (#355)
1 parent ff1f6a2 commit 55dc5ff

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
## Change Logs
22

3+
### 1.2.0
4+
5+
- Feature:
6+
- Drop support for 3.7 (#356)
7+
8+
- Fixes:
9+
- Fix: user/password replacement is not allowed for relative URLs (#349)
10+
- Fix pulsar client does not support init arguments other than service_url (#351)
11+
- Fix outdated make dev-fix rule in CodeStyle.md (#350)
12+
- Fix TestClient for fastapi cause the req.client None error (#355)
13+
314
### 1.1.0
415

516
- Feature:

skywalking/plugins/sw_fastapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async def create_span(self, method, scope, req, send, receive):
5656
with span:
5757
span.layer = Layer.Http
5858
span.component = Component.FastAPI
59-
span.peer = f'{req.client.host}:{req.client.port}'
59+
span.peer = f'{req.client.host}:{req.client.port}' if req.client else 'unknown'
6060
span.tag(TagHttpMethod(method))
6161
span.tag(TagHttpURL(str(req.url).split('?')[0]))
6262
if config.plugin_fastapi_collect_http_params and req.query_params:

0 commit comments

Comments
 (0)