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

Fails to deref https schemas, strips https off URL, ignores 301 redirect to https #46

Closed
n1ywb opened this issue Aug 2, 2017 · 8 comments
Labels

Comments

@n1ywb
Copy link
Contributor

n1ywb commented Aug 2, 2017

image

url == //json.readingpl.us/schemas/alertType.json

url SHOULD equal https://json.readingpl.us/schemas/alertType.json

When redirected to HTTPS resource, it instead requests the HTTP resource again

image

@n1ywb
Copy link
Contributor Author

n1ywb commented Aug 9, 2017

I noticed that this behavior does not occur when I serve my app with https.

@JamesMessinger
Copy link
Member

This error is caused by the URL resolution logic in the library. It currently defaults to the protocol of the host page, rather than the protocol of the schema URL.

@rickyblaha
Copy link

+1

@rickyblaha
Copy link

I ended up writing my own resolver. Thanks for the awesome, easy to extend library :)

@big-r81
Copy link
Contributor

big-r81 commented Nov 6, 2017

Hi,

this is a real problem and you can run into CORS problems too, see #58.
If I debug and adding https in front of the url starting with "//...", the schema is fetched fine...

But I didn't find out, where the protocol is lost... /EDIT: See Fix #59
@BigstickCarpet Can you help?

big-r81 added a commit to big-r81/json-schema-ref-parser that referenced this issue Nov 6, 2017
Hi,

the protocol wasn't present in the HTTP/HTTPS Get request.
Fixes APIDevTools#58 and maybe partial APIDevTools#46.
@JamesMessinger
Copy link
Member

This issue was fixed by PR #59 and released in version 4.0.4

@big-r81
Copy link
Contributor

big-r81 commented Nov 6, 2017

@BigstickCarpet

This issue is only partial fixed.

It won't follow the redirect for me. That still needs to be corrected!

@JamesMessinger
Copy link
Member

Oh... I didn't even notice the redirect part of the issue. I thought it was just about the protocol bug.

Let's separate this into two different issues. If the protocol bug is fixed, but the redirect bug is not, then can you create a new issue for just the redirect bug? That'll make things easier to track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants