azuretls-client icon indicating copy to clipboard operation
azuretls-client copied to clipboard

HTTP2 stream id difference in "HEADERS" frame_type of Firefox mimic

Open plzcloseyoureyes opened this issue 3 months ago • 1 comments

Describe the bug Testing was made on https://tls.peet.ws/api/all Image Left is azure, right is Firefox 143 latest on Windows. There's a difference in the stream_id, not an expert but i would guess it could be used to detect the client.

To Reproduce

package main

import (
	"fmt"

	"github.com/Noooste/azuretls-client"
)

func main() {
	session := azuretls.NewSession()
	session.Browser = azuretls.Firefox
	session.InsecureSkipVerify = true

	response, err := session.Do(&azuretls.Request{
		Method: "GET", // Changed to POST since we're sending a body
		Url:    "https://tls.peet.ws/api/all",
		OrderedHeaders: azuretls.OrderedHeaders{
			{"User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:143.0) Gecko/20100101 Firefox/143.0"},
			{"Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},
			{"Accept-Language", "en-US,en;q=0.5"},
			{"Accept-Encoding", "gzip, deflate, br, zstd"},
			{"Upgrade-Insecure-Requests", "1"},
			{"Sec-Fetch-Dest", "document"},
			{"Sec-Fetch-Mode", "navigate"},
			{"Sec-Fetch-Site", "none"},
			{"Sec-Fetch-User", "?1"},
			{"Priority", "u=0, i"},
			{"Te", "trailers"},
		},
		InsecureSkipVerify: true,
	})

	if err != nil {
		panic(err)
	}

	fmt.Println(response.Header["Content-Encoding"])
	fmt.Println(response.HttpResponse.Proto)
	fmt.Println(response.String())
} 

Expected behavior when Browser is set to Firefox stream_id of "HEADERS" on http2 should be identical to this of a real Firefox browser

Additional context stream_id is persistent across macOS and Windows on latest Firefox, shows 3. on Chrome its 1 so its good for that.

plzcloseyoureyes avatar Sep 25 '25 01:09 plzcloseyoureyes

Hello, thanks for this report. This addition is new to Firefox. I will look into it and give it a patch.

Noooste avatar Sep 26 '25 13:09 Noooste