These normalizations may be overly paranoid (we could just expect that `host` and `path` are passed to the function in the appropriate form and that the leading `.` has already been added as necessary) although I don't think they hurt anything.