Open jclingan opened 3 years ago
/cc @geoand
Thanks for reporting @jclingan!
This will be a whole a lot easier to fix when we pivot the spring web compatibility to RESTEasy Reactive, so unless you really really need this soon, I'd rather wait.
This is for the book Ken and I are writing. Yeah, shameless plug, LOL. I can put a NOTE in the book for now and wait for the fix.
Great, thanks 👍
Any update?
Not yet.
I hope to rebase the Spring Web support on RESTEasy Reactive some time before 2.x
I will likely work on this after the 2.2 stabilization release is out
Nudge :-)
I had to revert the "rebase" onto RESTEasy Reactive. I will hopefully get back to it before 2.5
@geoand Thanks for your work and how can we get the request headers if we can't use @RequestHeader
I have try this and also failed. It just tell me javaax.ws.rs.NorSupportException
@GetMapping
public String hello(@Context HttpHeaders headers) {
Thanks any help.
update
The code should be:
@Context HttpHeaders headers
@GetMapping
public String hello() {
// use headers to do something
}
@liangyuanpeng yup, as you mention one can mix and match the Spring and JAX-RS annotations and types.
Hi! is this issue still relevant? @jclingan @liangyuanpeng If yes, can I have a reproducer? Otherwise, can I close it?
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 exceptionExpected 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 aMap
. The reproducer is literally a project generated from code.quarkus.io with the Spring Web extension, with thehello()
method updated as follows;