Oh yikes, that’s bad. (I didn’t spot your source code comment at first—sorry.) I wonder whether that wouldn’t be recognised as a bug in the `uri` library in the first place.

Would still be nice to extract all the logic for getting host, port and path into a separate method.