The trickiness comes with Apache, because no matter what the browser sends in the Host header, it replaces the host portion with the configured serverName. So if you pass:
Host: foo.bar.baz.com:8888but if Apache has "foo" in the httpd.conf, Apache will change the header to have
Host: foo:8888
The way this came to my attention is when a customer reported some of our site wasn't working. The url being used by the component was "http://serverName:8888/whateverUrlIs.do?foo=blargh" even though if you looked at the browser, the address is "http://serverName.fullhost.fulldomain.com:8888/whateverUrlIs.do?foo=blargh". This was a bit of pain as nowhere in our code were we shortening the host name. It ended up that OAS was installed with just the host name rather than the full host name.
OAS doesn't let you change the server name through a nice gui, but it is easy enough to edit the httpd.conf file through the advanced pane or directly in the file system.
So I wonder: why does OAS/Apache change the passed HTTP headers? This makes debugging a real pain. So now, one of my first debugging steps is running the app in jboss, oc4j or websphere to make sure the app server isn't doing something weird to the request. I had similar headaches with WebSphere on AIX/zOS not liking the Content-Type header with my SOAP requests.