3 ms·
It makes a lot of sense if you pull your head out of the code and consider a URL is a universal resource locator. I don’t agree with what this is doing... but
by whalesalad 7y ago
It makes a lot of sense if you pull your head out of the code and consider a URL is a universal resource locator.
I don’t agree with what this is doing... but you can’t say it makes no sense at all.
- strictnein 7y agoWith this definition two different resources could be said to have the equivalent universal resource locators. foo.bar/baz would be said to be equivalent to bar.wack/baz if they shared the same IP address. If there is some sense to be made from that, it eludes me.
- lkschubert8 7y agoI think the argument is the domain name is an abstraction over ip address and ip address is the definitive "resource".
- kstrauser 7y agoIt definitely doesn't make sense, because two unrelated hosts can share the same IP. If you tried to fetch http://a.b.c.d/some/path http://a.b.c.d/some/path, then the server will fail because it doesn't know which host you mean. In this case, Java has thrown away the critical distinction between the two.
- sjwright 7y agoAnd it especially doesn’t make sense because resolving to the same IP on the server right now doesn’t guarantee it will resolve the same on the client, or even on the same server in 15 minutes time.
- desc 7y ago* A URL is a name for a pointer. * A URL is a parameter to a function returning a resource. * A URL is a string, conforming to a certain format. Neither of these specifies that the resource it points to is always the same resource, nor that it's always possible to resolve it. That's by design; hostnames change. The Web is not permanent and that's why we have eg. HTTP 404. Network topologies also change. However, the default equals() comparison between two objects is supposed to compare those two objects, not the current topology of the Internet. There is no way this behaviour ever made sense, nor any way it ever could make sense. It's moronic, through and through, for any language or library, to implement default equality in this way. If you want to implement a comparer which does stuff like this and accepts a hostname resolver as a dependency, great. But there is simply no excuse for this kind of stupidity in a default dependency-less implementation.