You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for contributing to Selenium! A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
I opened PR with initial changes. i have already asked some questions about feature in feature request ticket
I will implement new tests as soon as I get more information about task details
Motivation and Context
according to #12697 I started to discover how to implement this feature
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
2, because the changes are limited to a few lines in a single file, modifying header handling to be case-insensitive. The logic is straightforward, but the impact on existing functionality should be carefully evaluated.
🧪 Relevant tests
No
⚡ Possible issues
Consistency Issue: The PR changes headers to be stored in lowercase, which might affect other parts of the system that rely on the original case format of headers.
+if (name == null) {+ throw new IllegalArgumentException("Header name cannot be null");+}
return removeHeader(name).addHeader(name.toLowerCase(), value);
Apply this suggestion
Suggestion importance[1-10]: 8
Why: Adding a null check is crucial to prevent runtime exceptions when the 'name' parameter is null. This is a significant improvement for robustness.
8
Best practice
Use Locale.ROOT in toLowerCase to ensure consistent behavior across locales
Consider using Locale.ROOT in the toLowerCase method to ensure consistent behavior across different locales.
Why: Using Locale.ROOT for toLowerCase ensures consistent behavior across different system locales, which is important for the predictability of HTTP header handling.
7
iampopovich
changed the title
initial changes for #12697 feature request
[java] case insensitive header names in http requests
Jun 6, 2024
Let's at least wait to merge this after the upcoming release so that Appium can run their tests against nightly and see if it causes them problems before a production release.
@diemol sure
The FederatedCredentialManagementTest could not be executed due to a process creation error on Windows, related to the long path to the executable file. As a result, the test failed three times, despite the successful execution of other tests.
This failure occurs frequently in test runs on Windows and is not directly related to the changes in the pull request.
oh...i see
I mentioned this in the feature request here. The failing tests need to be fixed under the assumption that headers are now case-insensitive. I will correct the existing tests and resubmit them for review.
@diemol please verify my changes in tests
I tried to preserve the logic of the checks, considering that header names are now case-insensitive. I also fixed the HttpMessage.setHeader method. Previously, it couldn't remove a header because the headers were set in lowercase, while the name was passed in an arbitrary case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
I opened PR with initial changes. i have already asked some questions about feature in feature request ticket
I will implement new tests as soon as I get more information about task details
Motivation and Context
according to #12697 I started to discover how to implement this feature
Types of changes
Checklist
PR Type
Enhancement
Description
setHeadermethod to ensure case-insensitive handling.addHeadermethod to ensure case-insensitive handling.Changes walkthrough 📝
HttpMessage.java
Normalize header names to lowercase in HTTP message handling.java/src/org/openqa/selenium/remote/http/HttpMessage.java
setHeadermethod.addHeadermethod.