Detect both host AND port when determing CORS request

A CORS request should be detected when either the host OR the port differ. As an example, a request from http://localhost:9000 to http://localhost will trigger the browser to send a CORS request.

This PR provides a test case and a patch that ensures this will occur.