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]: use lowercase header names #12697

Closed
joerg1985 opened this issue Sep 6, 2023 · 9 comments · Fixed by #14095
Closed

[🚀 Feature]: use lowercase header names #12697

joerg1985 opened this issue Sep 6, 2023 · 9 comments · Fixed by #14095
Labels
C-java Java Bindings I-enhancement Something could be better
Milestone

Comments

@joerg1985
Copy link
Member

Feature and motivation

I would suggest to convert all header names to lowercase in the HttpMessage.
It might be helpful in the future to have only lower case header names.

The header names should be in general treated case-insensitive, but there might be code somewhere not aware of this, so i would see this in Selenium 5.

Usage example

There is currently a hidden issue due to the case-sensitive map used in the HttpMessage.
The order of headers set depends currently on the map implementation and not on the order of adding them, this can be observed here:

message.addHeader("Content-Length", "1024");
message.addHeader("Content-length", "2048");
message.addHeader("content-length", "4096");
assertThat(message.getHeader("Content-Length")).isEqualTo("4096");

message.getHeader("Content-Length") should actually return "1024"

@joerg1985 joerg1985 added I-enhancement Something could be better A-needs-triaging A Selenium member will evaluate this soon! labels Sep 6, 2023
@joerg1985 joerg1985 added this to the Selenium 5.0 milestone Sep 6, 2023
@github-actions
Copy link

github-actions bot commented Sep 6, 2023

@joerg1985, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@diemol diemol removed the A-needs-triaging A Selenium member will evaluate this soon! label Sep 6, 2023
@diemol
Copy link
Member

diemol commented Sep 6, 2023

Makes sense to me.

@pujagani pujagani added the C-java Java Bindings label Sep 14, 2023
@VAIBHAVPANT07
Copy link

assign me

@titusfortner
Copy link
Member

We don't assign specific issues, but if you make a PR we'll happily review it. Thanks.

@manuelsblanco
Copy link
Contributor

@diemol Is this still a issue? Can I take it?

@diemol
Copy link
Member

diemol commented Jan 10, 2024

@joerg1985 is this still pending?

@joerg1985
Copy link
Member Author

@diemol yes this is still open, as it is in milestone selenium 5.0.
I think this could be implemented earlier, but there is a risk for e.g. appium to run into troubles.

@iampopovich
Copy link
Contributor

iampopovich commented Jun 6, 2024

@diemol @titusfortner What should we do with the HttpMessageTest class after the changes?
If the header names become case-insensitive, all tests will fail. Should we modify the logic of the existing tests or write new ones?

iampopovich added a commit to iampopovich/selenium that referenced this issue Jun 6, 2024
@diemol diemol linked a pull request Aug 9, 2024 that will close this issue
8 tasks
Copy link

github-actions bot commented Dec 8, 2024

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C-java Java Bindings I-enhancement Something could be better
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants