Skip to content

Commit 4487ec3

Browse files
committed
Fix: user/password replacement is not allowed for relative urls
fix error `user/password replacement is not allowed for relative URLs` when using the parameter base_url of ClientSession constructor to send aiohttp requests
1 parent 28602ae commit 4487ec3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

skywalking/plugins/sw_aiohttp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def install():
4040
_request = ClientSession._request
4141

4242
async def _sw_request(self: ClientSession, method: str, str_or_url, **kwargs):
43-
url = URL(str_or_url).with_user(None).with_password(None)
43+
url = self._build_url(str_or_url).with_user(None).with_password(None)
4444
peer = f"{url.host or ''}:{url.port or ''}"
4545

4646
if config.agent_protocol == 'http' and config.agent_collector_backend_services.rstrip('/') \

0 commit comments

Comments
 (0)