quarkus: Quarkus returns 404 on OPTIONS request for the static resources

Describe the bug

I have static resources under the /src/resources/META-INF/resources folder (ex.: /src/resources/META-INF/resources/img/document.png.

When I make a GET call for the resource - Qurkus responds with 200 OK and returns the resource But when I make an OPTIONS call for the same resource - Quarkus responds with 404 Not found

Expected behavior

I expected 200 OK on the OPTIONS request for the static resources.

Actual behavior

Quarkus responds with 404 Not found on the OPTIONS request for the static resources

How to Reproduce?

  1. Add a static resource to the sample Quarkus project under the /src/resources/META-INF/resources folder
  2. Try to call this resource with GET and OPTIONS requests.

Sample of RestAssured @QuarkusTest

  • the following example returns image
RestAssured.given()
            .contentType(ContentType.JSON)
            .get("/img/document.png")
            .then()
            .statusCode(Matchers.equalTo(200))
  • the following example failed with the error message [java.lang.AssertionError: 1 expectation failed. Expected status code <200> but was <404>.]
RestAssured.given()
            .contentType(ContentType.JSON)
            .options("/img/document.png")
            .then()
            .statusCode(Matchers.equalTo(200))

Output of uname -a or ver

linux, macOS, Windows

Output of java -version

openjdk 17.0.2 2022-01-18

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.16.5.Final

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

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 21 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Yeah, I’ll have a look later today.

Cool, let’s close this one then