You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Model Name: MacBook Pro
Chip: Apple M1 Pro
Total Number of Cores: 10 (8 performance and 2 efficiency)
Memory: 16 GB
Issue description
I recieve following error failed to do request: Get "https://httpbin.org/deflate": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
when making request with tls-client.
I think it's related to decompression. It works for gzip and brotli compression but gives error for deflate.
Steps to reproduce / Code Sample
package main
import (
"fmt""io""strings"
fhttp "github.com/bogdanfinn/fhttp"
tls_client "github.com/bogdanfinn/tls-client"
profiles "github.com/bogdanfinn/tls-client/profiles"
)
funcmain() {
// Create client with Firefox browser profileoptions:= []tls_client.HttpClientOption{
tls_client.WithTimeoutSeconds(30),
tls_client.WithClientProfile(profiles.Chrome_131),
tls_client.WithDebug(),
// tls_client.WithForceHttp1(),
}
client, err:=tls_client.NewHttpClient(tls_client.NewNoopLogger(), options...)
iferr!=nil {
fmt.Printf("Failed to create client: %v\n", err)
return
}
url:="https://httpbin.org/deflate"// Create a test requestreq, err:=fhttp.NewRequest("GET", url, strings.NewReader(""))
iferr!=nil {
fmt.Printf("Failed to create request: %v\n", err)
return
}
// Set some basic headersreq.Header= fhttp.Header{
"accept": {"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"},
"accept-language": {"en-US,en;q=0.5"},
"accept-encoding": {"deflate"},
"user-agent": {"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0"},
}
// Enable redirect followingclient.SetFollowRedirect(true)
// Make the requestfmt.Println("Sending request...")
resp, err:=client.Do(req)
iferr!=nil {
fmt.Printf("Request failed: %v\n", err)
return
}
deferresp.Body.Close()
// Read and print responsefmt.Printf("Status Code: %d\n", resp.StatusCode)
fmt.Println("Headers:", resp.Header)
// decomBody := fhttp.DecompressBody(resp)body, err:=io.ReadAll(resp.Body)
iferr!=nil {
fmt.Printf("Failed to read body: %v\n", err)
return
}
fmt.Println("Body:", string(body))
}
The text was updated successfully, but these errors were encountered:
TLS client version
v1.7.10
System information
Model Name: MacBook Pro
Chip: Apple M1 Pro
Total Number of Cores: 10 (8 performance and 2 efficiency)
Memory: 16 GB
Issue description
I recieve following error
failed to do request: Get "https://httpbin.org/deflate": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
when making request with tls-client.
I think it's related to decompression. It works for gzip and brotli compression but gives error for deflate.
Steps to reproduce / Code Sample
The text was updated successfully, but these errors were encountered: