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

Header parameters and Redirect #1935

Closed
glederrey opened this issue Feb 1, 2016 · 10 comments
Closed

Header parameters and Redirect #1935

glederrey opened this issue Feb 1, 2016 · 10 comments

Comments

@glederrey
Copy link

Hi,

I encountered a problem using Swagger-UI.. (There's no problem while using the Web Browser or a client library generated by Codegen)

First, le me explain my call.. I call a function that will process some things and then will redirect to another page to send back a picture.. I attached a screenshot under it..

screen2

This is "working".. (Still have some issues with getting the picture, see #1848).. But the problem comes when I'm entering some headers parameters (here appId and appKey).. Swagger-UI does then a OPTIONS call before doing the POST one and don't do anything after that.. Normally, it should redirect as it is done before (without the headers parameters).. See the calls on the second screnshot..

screen1

Am I doing something wrong with the headers?? Or does anyone also encountered this problem??

Thank you

@webron
Copy link
Contributor

webron commented Feb 1, 2016

Have you added the headers to your CORS configuration?

@glederrey
Copy link
Author

Hi @webron,

Yes, I added them into the Access-Control-Allow-Headers.. That's what you meant by your question??

@webron
Copy link
Contributor

webron commented Feb 1, 2016

Yes. Can you share the output of curl -I <url of api>?

@glederrey
Copy link
Author

@webron I'll give you the output at 09-10am CET.. I don't have my computer for the work..

@glederrey
Copy link
Author

@webron Here is the output.. There's something weird because it says that the HEAD requests are not supported..

curl -I http://localhost:8080/nviso/api/cloud/v1/worker/nviso/photo/process/url
HTTP/1.1 405 Request method 'HEAD' not supported
Date: Tue, 02 Feb 2016 08:49:02 GMT
Allow: GET
Content-Type: text/html; charset=ISO-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 385
Server: Jetty(9.2.9.v20150224)

@webron
Copy link
Contributor

webron commented Feb 2, 2016

Yup, and it also doesn't show the CORS headers. So either they are not set, or the lack of HEAD support is going to make it more difficult to investigate.

@glederrey
Copy link
Author

The things is that I'm using the Spring MVC server generated using Swagger Codegen.. So, do you know if there's a way to accept the HEAD requests??

@webron
Copy link
Contributor

webron commented Feb 3, 2016

There are resources on the web on how to enable it, but that also depends on the Spring version and so on. I'd suggest doing a quick search on that.

@glederrey
Copy link
Author

Okay, I will do that.. Thank you for your help..

@ravibhushan29
Copy link

add another cors extension to chrome... and enable it ... then it will work

@webron webron closed this as completed Jun 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants