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

Suppress default HTTP headers #304

Closed
engn33r opened this issue Mar 15, 2021 · 1 comment
Closed

Suppress default HTTP headers #304

engn33r opened this issue Mar 15, 2021 · 1 comment

Comments

@engn33r
Copy link
Contributor

engn33r commented Mar 15, 2021

The HTTP headers User-Agent, Accept, and Accept-Encoding appear to always be set in HTTP requests, with no way to remove or suppress them. I believe that the Accept header is set in /modules/http/scanner.go, but can someone point me to where the User-Agent and Accept-Encoding headers are set for each HTTP request?

It would be great if there was a --suppress-default-headers flag to avoid these headers being added into every HTTP request and I can look into implementing it. I applaud PR #284 for the HTTP header customization features it introduces, but I think that suppressing the User-Agent and Accept-Encoding headers may require modifications outside of the /modules/http/scanner.go file.

@engn33r
Copy link
Contributor Author

engn33r commented Mar 20, 2021

I had to modify several files (/lib/http/client.go, /lib/http/request.go, /lib/http/transport.go, /modules/http/scanner.go) and I almost certainly broke some things in the process, but I implemented this in my fork if anyone is interested. I don't think a PR of this would help in the current form I implemented it, except perhaps the flag I implemented to remove the Accept header, but let me know if I'm mistaken.

@engn33r engn33r closed this as completed Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant