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

Java Implementation not sending Authorization and Host header #6303

Open
dudumiquim opened this issue Jun 27, 2024 · 1 comment
Open

Java Implementation not sending Authorization and Host header #6303

dudumiquim opened this issue Jun 27, 2024 · 1 comment

Comments

@dudumiquim
Copy link

Expected behavior

I'm using Java implementation because it is faster than HttpClient4. I expected that my headers would be sent independently of the implementation.

Actual behavior

When I change from HttpClient4 to Java, some headers are not sent.

Steps to reproduce the problem

My Config:

db3d72-e78d2c70-0d6d-4867-b5a7-b9135328de14

When I run using Java Implementation, the Authorization and Host header is not sent

image

When I change from Java to HttpClient4 implementation, Authorization and Host header is sent

image

JMeter Version

5.6.3

Java Version

Java(TM) SE Runtime Environment (build 1.8.0_411-b09)

OS Version

Microsoft Windows [versão 10.0.22631.3737]

@buzzerrookie
Copy link

Actually these headers have been sent and you can verify by Wireshark or other network sniffers.
The Java HttpURLConnection automatically hides the Authorization header when getting request headers from HttpURLConnection, thus it can not be accessed by user. The Host and User-Agent headers are automatically sent by HttpURLConnection but you can still overwrite them via Header Manager.
When the Host and User-Agent headers are set in Header Manager, they will appear in the Request Headers panel. The Authorization header should be placed in HTTP Authorization Manager and it will apper in the Request Headers panel.
I don't know whether the two implementations should keep a consistent appearance in the Request Headers panel. If so, I'm glad to help if the JMeter owner determines to improve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants