Skip to content

Resteasy-reactive: HEAD returns 405 in the REST resource in some cases #49172

@mposolda

Description

@mposolda

Describe the bug

Assume that I have:

  • JAX-RS REST resource class with the GET method and some @path like for example this:
    @GET
    @Path("/subpath")
    public String get() {
        return "y";
    }

As long as this is the only method on the resource (or there are some other "resource" methods with the HTTP method annotations), then HTTP method HEAD method works as expected and returns the headers for this resource. However when this class has another resource without HTTP method. For example something like this:

    @Path("/zpath")
    public ZResource getAnotherResource() {
        return CDI.current()
                .select(ZResource.class)
                .get();
    }

Then method HEAD on the original resource (with path /subpath) returns "405 Method not allowed" . The GET method on the /subpath works as expected and returns 200 and successful response. Only the method HEAD is broken.

Expected behavior

Method HEAD works and returns 200

Actual behavior

Method HEAD does not work and returns 405

How to Reproduce?

Created reproducer project here: https://github.com/mposolda/quarkus-reproducer-resteasy-head-bug

When running mvnw test there is failing test due this bug

Output of uname -a or ver

Linux mposolda-ThinkPad-P1-Gen-7 6.14.0-24-generic #24~24.04.3-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 7 16:39:17 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "21.0.8" 2025-07-15 OpenJDK Runtime Environment (build 21.0.8+9-Ubuntu-0ubuntu124.04.1) OpenJDK 64-Bit Server VM (build 21.0.8+9-Ubuntu-0ubuntu124.04.1, mixed mode, sharing)

Quarkus version or git rev

3.24.5

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

Apache Maven 3.9.8

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions