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

Setting headers for SSE annotated Multi resources is ignoring headers #44902

Closed
dastrobu opened this issue Dec 3, 2024 · 3 comments · Fixed by #44903
Closed

Setting headers for SSE annotated Multi resources is ignoring headers #44902

dastrobu opened this issue Dec 3, 2024 · 3 comments · Fixed by #44903
Labels
area/rest kind/bug Something isn't working
Milestone

Comments

@dastrobu
Copy link
Contributor

dastrobu commented Dec 3, 2024

Describe the bug

Setting response headers as shown below does not work when the resource is annotated with @Produces(MediaType.SERVER_SENT_EVENTS) or @RestStreamElementType(MediaType.APPLICATION_JSON).

        @POST
        @Path("sse-multi")
        @Produces(MediaType.SERVER_SENT_EVENTS)
        public Multi<String> sseMulti() {
            return RestMulti.fromMultiData(Multi.createFrom().items("hello", "world")).header("Foo", "Bar").build();
        }

See also #44898 (comment)

Expected behavior

headers are set as in

        @POST
        @Path("multi")
        public Multi<String> multi() {
            return RestMulti.fromMultiData(Multi.createFrom().items("hello", "world")).header("Foo", "Bar").build();
        }

Actual behavior

header is ignored

How to Reproduce?

I will provide a draft PR with a unit test.

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Copy link

quarkus-bot bot commented Dec 3, 2024

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

@geoand
Copy link
Contributor

geoand commented Dec 3, 2024

We need to add RestMulti support to SSE handling

@geoand geoand changed the title Stetting headers for SSE annotated Multi resources is ignoring headers. Setting headers for SSE annotated Multi resources is ignoring headers. Dec 3, 2024
@geoand
Copy link
Contributor

geoand commented Dec 4, 2024

#44903 takes care of this

@geoand geoand changed the title Setting headers for SSE annotated Multi resources is ignoring headers. Setting headers for SSE annotated Multi resources is ignoring headers Dec 4, 2024
@quarkus-bot quarkus-bot bot added this to the 3.18 - main milestone Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants