Skip to content

[🚀 Feature]: use lowercase header names #12697

Description

@joerg1985

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"

Activity

added this to the Selenium 5.0 milestone on Sep 6, 2023

github-actions commented on Sep 6, 2023

@github-actions
Contributor

@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 commented on Sep 6, 2023

@diemol
Member

Makes sense to me.

VAIBHAVPANT07 commented on Oct 14, 2023

@VAIBHAVPANT07

assign me

titusfortner commented on Oct 14, 2023

@titusfortner
Member

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

manuelsblanco commented on Jan 10, 2024

@manuelsblanco
Contributor

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

diemol commented on Jan 10, 2024

@diemol
Member

@joerg1985 is this still pending?

joerg1985 commented on Jan 10, 2024

@joerg1985
MemberAuthor

@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 commented on Jun 6, 2024

@iampopovich
Contributor

@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?

added a commit that references this issue on Jun 6, 2024

github-actions commented on Dec 8, 2024

@github-actions
Contributor

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.

locked and limited conversation to collaborators on Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-javaJava BindingsI-enhancementSomething could be better

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions