Description
openedon Dec 25, 2020
Describe the bug
I'm trying to access all request headers using Spring @RequestHeader
in the same way that @Context HttpHeaders headers
would provide access to all request headers.
When starting the application with mvn quarkus:dev
, I get the following exception
Caused by: java.lang.RuntimeException: RESTEASY003875: Unable to find a constructor that takes a String param or a
valueOf() or fromString() method for javax.ws.rs.HeaderParam("headers") on public java.lang.String
org.acme.SpringGreetingController.hello(java.util.Map) for basetype: java.util.Map
Expected behavior
A populated Map with HTTP headers, preferably a MultiValuedMap.
Actual behavior
Above exception.
To Reproduce
See reproducer. Note, I'd like to use the Spring MultiValueMap
, although the reproducer uses a Map
.
The reproducer is literally a project generated from code.quarkus.io with the Spring Web extension, with the hello()
method updated as follows;
public String hello(@RequestHeader MultiValueMap<String, String> headers) {
headers.forEach((key, value) -> {
System.out.println(key + "->" + value);
})