Why the recursive call here? I think this drops the port (which might be important) and path (which probably isn't, but you never know)

Couldn't this just call whiteList.add with a modified host?