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

OPTIONS Request on /openapi => infinite loading #10604

Closed
dobbidev opened this issue Jul 9, 2020 · 3 comments · Fixed by #10612
Closed

OPTIONS Request on /openapi => infinite loading #10604

dobbidev opened this issue Jul 9, 2020 · 3 comments · Fixed by #10612
Labels
area/openapi kind/bug Something isn't working
Milestone

Comments

@dobbidev
Copy link
Contributor

dobbidev commented Jul 9, 2020

Describe the bug
The bug is located in the following extension: quarkus-smallrye-openapi

When I call "http://localhost:8080/openapi" with the OPTIONS Method, it keeps loading like something freeze the request

Expected behavior
It should return an 200er and the allowed methods

To Reproduce
Steps to reproduce the behavior:

  1. clone https://github.com/quarkusio/quarkus-quickstarts.git
  2. go to openapi-swaggerui-quickstart
  3. run it
  4. call
    curl --request OPTIONS
    --url http://localhost:8080/openapi

Screenshots
image

Solution could be
In this class:
https://github.com/quarkusio/quarkus/blob/master/extensions/smallrye-openapi/runtime/src/main/java/io/quarkus/smallrye/openapi/runtime/OpenApiHandler.java

 if (event.request().method().equals(HttpMethod.OPTIONS)) {
            addCorsResponseHeaders(event.response());
            event.response().headers().set("Allow", ALLOWED_METHODS);
}

I think it miss the call next on the event

 if (event.request().method().equals(HttpMethod.OPTIONS)) {
            addCorsResponseHeaders(event.response());
            event.response().headers().set("Allow", ALLOWED_METHODS);
            event.next(); 
}
@dobbidev dobbidev added the kind/bug Something isn't working label Jul 9, 2020
@quarkusbot
Copy link

@gastaldi
Copy link
Contributor

gastaldi commented Jul 9, 2020

@Machareder that makes sense. Are you interested in providing a Pull-Request?

@dobbidev
Copy link
Contributor Author

dobbidev commented Jul 9, 2020

@gastaldi

#10612

I hope the Pull-Request is provided correctly

@gastaldi gastaldi linked a pull request Jul 9, 2020 that will close this issue
@gsmet gsmet added this to the 1.6.1.Final milestone Jul 16, 2020
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/openapi kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants