URL parsing fix

Fixed URL parsing to handle localhost and URLs encoded as value of query parameter