3 ms·
I can see why a method like this could be helpful. The URL specification RFC has an incredibly flexible specification for what constitutes a URL. The hostname/a
by TimTheTinker 7y ago
I can see why a method like this could be helpful. The URL specification RFC has an incredibly flexible specification for what constitutes a URL. The hostname/address section can be particularly hairy - to the point that it likely becomes impractical/infeasible to compare hostnames for equality. Comparison via DNS resolution is likely a simple, desirable solution to a real problem.
That being said, URL.equals() is a terribly opaque and non-obvious method signature for performing DNS-based comparisons of hostnames. It lacks any indication that calling it involves network IO.
- tuwtuwtuwtuw 7y agoThis is only a desirable solution if you ignore basic internet stuff such as round robin resolution, non-infinite-TTL, SNI and Host headers. Even the authors realized it was a bad idea...
- keymone 7y agoI can’t see when can it be helpful. Resolving an ip shows you only a subset of dns information, basing equality on this behavior makes zero sense. It should have been deprecated and removed long time ago. Backward compatibility like this is cancer.