@sirthias What bothers me is the following:
1) val uri = Uri("http://host:80/path?query#fragment")     - uri has port == 80
2) uri.withScheme("https") === Uri("https://host/path?query#fragment")
2.1) uriWithScheme (the left hand value) has scheme 'https' but still has port == 80. That's OK.
2.2) the right hand Uri (Uri("https://host/path?query#fragment")) is a completely new instance that is just created. Since the port is not explicitly specified I'd expect that it should be calculated from the scheme. I.e. I'd expect the right hand Uri to have port == 443