Closed adityathebe closed 10 months ago
I didn't reproduce that, can you share a reproducable code with that?
I didn't reproduce that, can you share a reproducable code with that?
package main
import (
"fmt"
"io"
"log"
"github.com/imroc/req/v3"
)
func main() {
userAgent := "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
url := "https://adityathebe.com"
client := req.C().SetUserAgent(userAgent).EnableForceHTTP3()
resp, err := client.R().Get(url)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(body)
}
go 1.21.0
require github.com/imroc/req/v3 v3.41.7
I didn't reproduce that, can you share a reproducable code with that?
package main import ( "fmt" "io" "log" "github.com/imroc/req/v3" ) func main() { userAgent := "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" url := "https://adityathebe.com" client := req.C().SetUserAgent(userAgent).EnableForceHTTP3() resp, err := client.R().Get(url) if err != nil { log.Fatal(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(body) }
go 1.21.0 require github.com/imroc/req/v3 v3.41.7
Still not reproduced.
That's weird. I've reproduced this in two different computers. Asked a friend and he could reproduce it as well.
Are you running go 1.21?
Oh I see, sorry that I used go 1.20 to test. Thanks for report, It's a bug, I have just fixed, and release a patch version, you can upgrade to the latest version.
Thanks. Works now 👍
I updated to v3.41.7 from v3.37.2 yesterday, since I was not able to build my old code with go 1.21. This is the exact code that was running before but now panics