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

Fix HTTPCLIENT-2331: Skip cookie header generation if a Cookie header is present #561

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

arturobernalg
Copy link
Member

Fix for HTTPCLIENT-2331: Single Cookie Header for Multiple Cookies

When an explicit Cookie header is added using setHeader() and multiple cookies exist in the BasicCookieStore, HttpClient was sending separate Cookie headers for the manually set cookies and the cookies in the store. This fix ensures that if a Cookie header is already present in the request, HttpClient skips adding additional Cookie headers from the BasicCookieStore.
This change conforms to the expectation that a single Cookie header should be sent where all cookies are separated by a semicolon, as per RFC6265.

… is already present

 This fix ensures that if a Cookie header is already present in the request, HttpClient skips adding additional Cookie headers from the BasicCookieStore.
Copy link
Member

@garydgregory garydgregory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test 👌

@arturobernalg arturobernalg merged commit 336263d into apache:master Jun 20, 2024
10 checks passed
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

Successfully merging this pull request may close these issues.

3 participants