diff --git a/aiohttp/client_reqrep.py b/aiohttp/client_reqrep.py index 8fac37fc00..fde9a661e8 100644 --- a/aiohttp/client_reqrep.py +++ b/aiohttp/client_reqrep.py @@ -360,7 +360,7 @@ def update_headers(self, headers: Optional[LooseHeaders]) -> None: assert netloc is not None # See https://github.com/aio-libs/aiohttp/issues/3636. if netloc[-1] == ".": - netloc = netloc[:-1] + netloc = netloc.rstrip(".") explicit_port = self.url.explicit_port if explicit_port is not None and not self.url.is_default_port(): netloc = f"{netloc}:{explicit_port}"