Closed jonathanstowe closed 9 years ago
That's odd. The library fix is for a scheme but the test is for a port. It sort of works but seems a little obscure. Why don't you do the test for the scheme too?
Because in the absence of a port in the parsed URI it uses the scheme to get the default port :) Testing it like kills two birds with one stone and is also the reason that I found it in the first place.
In a number of places you may not know in advance whether you are going to get a relative or fully qualified URI, this saves checking a "safe" method before attempting to to use the scheme.