Consider changing default heuristic parse to https
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.
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.
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.
@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! 🤔
Ah right, you can pass hints to the heuristic parse method. I forgot about that.
https://github.com/sporkmonger/addressable/blob/4229164843616783287ca359bbe38b574f1908a3/lib/addressable/uri.rb#L188
So it is only a matter of changing that. (Which we should only do in a new major version IMHO)
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.