Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Add possibility to FULLY REMOVE the User-Agent Header on CONNECT Request #140

Open
CabboShiba opened this issue Nov 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@CabboShiba
Copy link

Describe the feature / enhancement and how it would improve things

As now you can set custom headers in the CONNECT request, but if the dictionary is empty it will use default one. It would be better to make that if the dictionary is empty it wont add any header, considering also that sometimes there isn't the User-Agent headers.

I tried to edit a bit the library used but without any success. If you have any suggestion let me know :)__

Describe how your proposal will work, with code and/or pseudo-code

If we pass a empty dictionary in the method WithConnectHeaders, the CONNECT request will not have any headers except for the Host one.

@CabboShiba CabboShiba added the enhancement New feature or request label Nov 19, 2024
@CabboShiba
Copy link
Author

Fixed by editing the FHTTP Lib. Before I couldnt make it working since I had replaced the package with a wrong one.
In order to remove it, edit the FHTTP lib: inside request.go, line 622, remove the following IF condition:

if uaCap, uaLow := r.Header["User-Agent"], r.Header["user-agent"]; uaCap == nil && uaLow == nil {
		r.Header.Set("User-Agent", "Go-http-client/1.1")
	}

Sorry for bad formatting lol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant