Skip to content

RequestTemplate does not conform to RFC7230 - case-insensitive header field names #570

@pisarek

Description

@pisarek

Hi,
Feign RequestTemplate's header field names are not case-insensitive.

Here is the RFC fragment in question:
https://tools.ietf.org/html/rfc7230#section-3.2

Here is the code fragment from RequestTemplate:

 private final Map<String, Collection<String>> headers =
      new LinkedHashMap<String, Collection<String>>();

And a JUnit test case:

@Test
public void headerFieldNamesShouldBeCaseInsensitive() throws Exception {
    RequestTemplate request = new RequestTemplate();
    String value = "value";
    request.header("TEST", value);
    assertThat(request.headers().get("test"), contains(value)); // Actual   :null
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected or incorrect behaviorhelp wantedIssues we need help with tackling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions