O a port will always be set when creating the ```env``` hash.

```ruby
env = {
  :method => method,
  :params => parameters,

  "SERVER_NAME"     => hostname,
  "SERVER_PORT"     => port || (https? ? "443" : "80"),
  "HTTPS"           => https? ? "on" : "off",
  "rack.url_scheme" => https? ? "https" : "http",

  "REQUEST_URI"    => path,
  "HTTP_HOST"      => host,
  "REMOTE_ADDR"    => remote_addr,
  "CONTENT_TYPE"   => "application/x-www-form-urlencoded",
  "HTTP_ACCEPT"    => accept
}
```