Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set dynamic response headers for all REST resources including Multi in a generic way #44904

Open
dastrobu opened this issue Dec 3, 2024 · 2 comments
Labels
area/rest kind/enhancement New feature or request

Comments

@dastrobu
Copy link
Contributor

dastrobu commented Dec 3, 2024

Description

I'd like to set custom response headers on all resources in a generic way.

The naive approach would be to implement a @ServerResponseFilter.
However, as pointed out in #44898 (comment), this approach does not work for resources returning a Multi.

Having a generic way to set custom response headers is a prerequisite to supporting features like setting a traceresponse header (see 11931 for an example use case).

Currently, one would need to implement a @ServerResponseFilter handling all non-multi resources and set the response headers on each multi resource individually with RestMulti.fromMultiData(...).headers. There is also #44902 preventing even this approach for SSE-annotated resources.

I'd propose reconsidering adding support for @ServerResponseFilter on Multi resources or thinking about an alternative way to set response headers in a generic, filter-like way.

Implementation ideas

No response

@dastrobu dastrobu added the kind/enhancement New feature or request label Dec 3, 2024
Copy link

quarkus-bot bot commented Dec 4, 2024

/cc @FroMage (rest), @stuartwdouglas (rest)

@geoand
Copy link
Contributor

geoand commented Dec 4, 2024

I am all for coming up with something better than the current state, but I am -1 on using @ServerResponseHandler for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants