Use the request object to get the host without port.

This is cleaner because the request object is always available and it
has a method to get the host without a port.