Skip to content

PHeader-Order present in the request #412

@vitidev

Description

@vitidev

Description

I followed the instructions in the readme.md

 go get github.com/Danny-Dasilva/CycleTLS/cycletls

and run golang JA4R Example

Sniffing showed that the headers were not removed from the request

GET /api/all HTTP/1.1
Host: tls.peet.ws
PHeader-Order: : :method
PHeader-Order: : :authority
PHeader-Order: : :scheme
PHeader-Order: : :path
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Connection: close

Issue Type

Bug

Operating System

Windows 10

Node Version

None

Golang Version

Other

Relevant Log Output

go version
go version go1.25.5 windows/amd64

upd:

That's because the Do method does not contain code

req.Header = http.Header{
	http.HeaderOrderKey: headerorderkey,
}

and therefore the header isn't being cleaned

func (h Header) writeSubset(w io.Writer, exclude map[string]bool, trace *httptrace.ClientTrace) error {
	...
	// Check if the HeaderOrder is defined.
	if headerOrder, ok := h[HeaderOrderKey]; ok {
		...
		mutex.Lock()
		exclude[HeaderOrderKey] = true
		exclude[PHeaderOrderKey] = true
		mutex.Unlock()

Metadata

Metadata

Assignees

Labels

triageThis ticket will be looked at shortly

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions