Skip to content

Commit

Permalink
fix: fix host substitution on HTTP client (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnicoulaud-ledger authored Dec 3, 2024
1 parent 02b6629 commit a3c209a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/erc7730/common/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def handle_request(self, request: Request) -> Response:

# substitute base URL if provided
if (api_host := os.environ.get(self.ETHERSCAN_API_HOST)) is not None:
request.url = URL(str(request.url).replace(ETHERSCAN, api_host))
request.url = request.url.copy_with(host=api_host)
request.headers.update({"Host": api_host})

# add API key if provided
Expand Down

0 comments on commit a3c209a

Please sign in to comment.