Skip to content

[πŸš€ Feature]: use lowercase header namesΒ #12697

@joerg1985

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"

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