imroc / req

Simple Go HTTP client with Black Magic
https://req.cool
MIT License
4.12k stars 334 forks source link

ImpersonateFirefox - connection error: PROTOCOL_ERROR #314

Open powellnorma opened 6 months ago

powellnorma commented 6 months ago

Using ImpersonateChrome instead works fine. The error seems to be generated in processPushPromise: https://github.com/imroc/req/blob/5323efe519c828b9b97dc52f13386e007e5972b5/internal/http2/transport.go#L3058

package main

import (
    "fmt"
    "log"

    "github.com/imroc/req/v3"
)

func main(){
    client := req.C().ImpersonateFirefox()

    // connection error: PROTOCOL_ERROR
    resp, err := client.R().Get("https://www.monosolutions.com/")

    if err != nil {
        log.Fatal(err)
    }

    fmt.Println(resp.String())
}