Skip to content

Commit

Permalink
display http3 error message even if user set timeout flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed TAHRI committed Mar 22, 2024
1 parent 8827c42 commit 74d62b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions httpie/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,11 @@ def collect_messages(
elif (
args.disable_http3 is False
and requests_session.quic_cache_layer.get((parsed_url.host, parsed_url.port or 443)) is not None
and send_kwargs["timeout"] is None
and args.force_http3 is False
):
# we only set the connect timeout, the rest is still indefinite.
send_kwargs["timeout"] = Timeout(connect=3)
if send_kwargs["timeout"] is None:
send_kwargs["timeout"] = Timeout(connect=3)
setattr(args, "_failsafe_http3", True)

if httpie_session:
Expand Down
1 change: 1 addition & 0 deletions tests/test_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def test_ensure_override_resolver_used(remote_httpbin):
"""Just an additional check to ensure we are wired properly to Niquests resolver parameter."""
r = http(
"--resolver=pie.dev:240.0.0.0", # override DNS response to TARPIT net addr.
"--disable-http3",
remote_httpbin + "/get",
tolerate_error_exit_status=True
)
Expand Down

0 comments on commit 74d62b8

Please sign in to comment.