snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

RESTEasy Reactive @NoCache unexpected behavior #408

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug

When using org.jboss.resteasy.reactive.NoCache without attributes (not using the fields attribute), response headers do not contain Cache-Control: no-cache header.

package org.acme;

import javax.ws.rs.GET;
import javax.ws.rs.Path;

import org.jboss.resteasy.reactive.NoCache;

@Path("/hello")
public class NoCacheResource {

    @GET
    @NoCache
    public String hello() {
        return "hello";
    }
}
curl --head http://localhost:8080/hello

This is also inconsistent with the documentation: https://quarkus.io/guides/resteasy-reactive#controlling-http-caching-features

Expected behavior

Response:

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Type: text/plain;charset=UTF-8

Actual behavior

Response:

HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8

How to Reproduce?

resteasy-reactive-nocache-reproducer.zip

unzip resteasy-reactive-nocache-reproducer.zip
cd resteasy-reactive-nocache-reproducer
./mvnw clean verify

Output of uname -a or ver

No response

Output of java -version

openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9) OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.2.1.Final

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

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)

Additional information

No response


https://github.com/quarkusio/quarkus/issues/19822


$upstream:19822$