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

Consider changing default heuristic parse to https #356

Open
sporkmonger opened this issue Aug 31, 2019 · 5 comments
Open

Consider changing default heuristic parse to https #356

sporkmonger opened this issue Aug 31, 2019 · 5 comments
Labels

Comments

@sporkmonger
Copy link
Owner

Currently heuristic_parse("example.com") returns "http://example.com/". At some point I think it'd be better to return "https://example.com/" but we may not be there just yet.

@danielvdao
Copy link

Hey @sporkmonger is there any update on this? Happy to grab it if there's no reason as to why not default https over http. My understanding is that it's a simple line change.

@dentarg
Copy link
Collaborator

dentarg commented Dec 27, 2024

It would be a breaking change. So a new major release. I wonder if it is worth it. Maybe it should be opt-in at first?

And it needs to be possible to go back to the old behavior.

@danielvdao
Copy link

danielvdao commented Dec 27, 2024

@dentarg ah yeah, you're right. Can you explain what you mean by opt-in? Isn't it opt-in today already? If I were to pass in Addressable::URI.heuristic_parse("www.foo.com", scheme: "https") that's opting into https scheme, right? Vice-versa by doing scheme: "http". Agreed that there should be a way for users to specify http at least.

I don't see why we shouldn't prefer https over http but curious to know what you think! 🤔

@dentarg
Copy link
Collaborator

dentarg commented Dec 28, 2024

Ah right, you can pass hints to the heuristic parse method. I forgot about that.

# Defaults to <code>{:scheme => "http"}</code>.

So it is only a matter of changing that. (Which we should only do in a new major version IMHO)

@dentarg
Copy link
Collaborator

dentarg commented Dec 28, 2024

Re: "is it worth it?"

This issue has been open for five years and there hasn't been a lot of user requests to change this default. Maybe because it is so easy to adjust it?

However, if we do change it, everyone that relies on the current default behavior has to take action.

Addressable doesn't change a lot these days and is mostly considered very stable.

If we would produce a major version with more major changes it would probably be worth changing this.

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

3 participants