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?
- Add a static resource to the sample Quarkus project under the
/src/resources/META-INF/resources
folder - 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
- Allow the OPTIONS method for static resources Fixes #32696 — committed to gsmet/quarkus by gsmet a year ago
- Allow the OPTIONS method for static resources Fixes #32696 — committed to holly-cummins/quarkus by gsmet a year ago
- Allow the OPTIONS method for static resources Fixes #32696 (cherry picked from commit 703ae09c3cdf7a18a3cc047f2e1eef986eae801a) — committed to gsmet/quarkus by gsmet a year ago
- chore(deps): update all non-major dependencies (mulk/quarkus-googlecloud-jsonlogging!15) This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io.quarkus:... — committed to benkard/quarkus-googlecloud-jsonlogging by deleted user a year ago
Yeah, I’ll have a look later today.
Cool, let’s close this one then