Should this be using `uri.scheme` and `uri.port`?