Fixed bug with parsing urls

If a base hostname was given without a trailing slash, for example
"http://example.com" instead of "http://example.com/", it would parse the host
name as a path. This change fixes that parsing error.