Skip to content

Handle case sensitivity in headers for Spring Boot apps #510

@StalkersGlue

Description

@StalkersGlue

Describe the bug
When defining headers on endpoints you can use upper casing. Spring by default lowercases headers. The emitted wirespec code will verify against the lowercased request header and it will fail.

To Reproduce
Steps to reproduce the behavior:

  1. Have a wirespec endpoint with #{Content-Type: String}
  2. Implement Spring boot app with @EnableWirespecController
  3. Call endpoint with header and see stacktrace.

Expected behavior
According to RFC 7230, HTTP header names are case-insensitive. This means Content-Type, content-type, CONTENT-TYPE, and Content-type are all equivalent.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions