selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🚀 Feature]: use lowercase header names

Open joerg1985 opened this issue 1 year ago • 8 comments

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: https://github.com/SeleniumHQ/selenium/blob/938058d969de2d2512eb8e3a47acea022927c4f2/java/test/org/openqa/selenium/remote/http/HttpMessageTest.java#L53-L57 message.getHeader("Content-Length") should actually return "1024"

joerg1985 avatar Sep 06 '23 16:09 joerg1985

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

github-actions[bot] avatar Sep 06 '23 16:09 github-actions[bot]

Makes sense to me.

diemol avatar Sep 06 '23 16:09 diemol

assign me

VAIBHAVPANT07 avatar Oct 14 '23 10:10 VAIBHAVPANT07

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

titusfortner avatar Oct 14 '23 19:10 titusfortner

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

manuelsblanco avatar Jan 10 '24 13:01 manuelsblanco

@joerg1985 is this still pending?

diemol avatar Jan 10 '24 13:01 diemol

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

joerg1985 avatar Jan 10 '24 15:01 joerg1985

@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 avatar Jun 06 '24 17:06 iampopovich