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

Add support for redirects #92

Open
vadeg opened this issue Jul 3, 2020 · 1 comment
Open

Add support for redirects #92

vadeg opened this issue Jul 3, 2020 · 1 comment

Comments

@vadeg
Copy link

vadeg commented Jul 3, 2020

When the DefaultURIDownloader tries to load a schema and got a response 301 Moved Permanently it tries to parse the body content and fails (For example check zalando/zally#1164).

Would be great if the DefaultURIDownloader could handle redirects and instead of failing, try to download schema again.

@sdoeringNew
Copy link
Contributor

The DefaultURIDownloader generally follows redirects. It does not follow redirects if the schema changes. Your example redirects from http://swagger.io/v2/schema.json# to https://schema.swagger.io/v2/schema.json. Therefore it fails.

And that behaviour is okay, see: https://stackoverflow.com/questions/1884230/httpurlconnection-doesnt-follow-redirect-from-http-to-https

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

2 participants