-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
Swagger UI API testing- 'Invalid CORS Request' response for all requests methods expect for 'GET' requests #488
Comments
@gmarziou The thread has been removed.Thanks |
Postman does not run in a web browser so it does not apply CORS restrictions. The registry is a Zuul proxy so it should not be different than a gateway, have you compared their configurations? |
The issue is resolved and it was straight forward :) The WebConfigurer.java
Just curious to know , could you please highlight the thought behind denying the CORS requests by default in registry where we have Swagger UI which can act as central resource to test all API's across microservices including gateway. |
I have no idea why this is done. @vishal423 do you remember why you made this change? 76a6efc |
The intention was to deny |
Overview of the issue:
version: 6.3.0
I have set up the Jhipster registry project for Swagger API documentation.Its now the central place for gateway and all other microservices API.
When testing API's for gateway and other microservices, if the request verb is other than 'GET',ie. if the request method is POST, PUT, DELETE- 'Invalid CORS request' is thrown.
Response status: 403, Invalid CORS request
All API requests with GET verb works fine.
Context path is configured as below:
jhipster registry: /registry
gateway: /gateway
In local(profile local) set up everything is working fine from Swagger UI, but once its deployed to respective environments requests starts failing.
PF the below swagger generated URL for API testing:
gateway authentication API:
https://xx.99.xx.64/registry/services/gateway/gateway:78b627b6a671cd1a33e53ae603e0eb12/gateway/api/authenticate
microservice: micro1
https://xx.99.xx.64/registry/services/micro1/micro1:a8ebfb8ee491ceceda595c63e3e87966/api/save
This APIs fails from swagger,but works fine when tested through Postman
CORS configuration for registry,gateway
Authentication: JWT
Couldn't figure out the issue as the set up works fine in local and the swagger generated API URLs responds successfully when tested from postman
The text was updated successfully, but these errors were encountered: