Inconsistent behavior with "Host:" header

O

ohaya

Hi,

I was doing some testing to try to find a problem that we've been
having, and I happen to be using IE6, along with a couple of different
browsers, and I ran across some really strange behavior with IE6.

In my testing, I was going to a test URL that was something like
http://myhost.foo.com:7777/foo, and was monitoring the HTTP traffic.

When I did this, the server logs, which show the various HTTP headers
in the request showed:

Host: myhost.foo.com

In other words, the port # (7777) was not included in the Host header.

I have a small program that acts as a kind of a proxy but dumps out the
HTTP traffic. I configured ..\etc\hosts file so that myhost.foo.com
would point to my proxy program, and when I pointed this same IE6
browser to http://myhost.foo.com:7777/foo, the proxy logs showed that
the request had:

Host: myhost.foo.com:7777

In other words, this time, the port # WAS included in the Host header.

Can someone explain why the Host header would include the
hostname:port# in one case, but only hostname in the other?

Thanks,
Jim
 
O

ohaya

ohaya said:
Hi,

I was doing some testing to try to find a problem that we've been
having, and I happen to be using IE6, along with a couple of different
browsers, and I ran across some really strange behavior with IE6.

In my testing, I was going to a test URL that was something like
http://myhost.foo.com:7777/foo, and was monitoring the HTTP traffic.

When I did this, the server logs, which show the various HTTP headers
in the request showed:

Host: myhost.foo.com

In other words, the port # (7777) was not included in the Host header.

I have a small program that acts as a kind of a proxy but dumps out the
HTTP traffic. I configured ..\etc\hosts file so that myhost.foo.com
would point to my proxy program, and when I pointed this same IE6
browser to http://myhost.foo.com:7777/foo, the proxy logs showed that
the request had:

Host: myhost.foo.com:7777

In other words, this time, the port # WAS included in the Host header.

Can someone explain why the Host header would include the
hostname:port# in one case, but only hostname in the other?

Thanks,
Jim


Hi,

Does anyone have any ideas about this problem? The original problem
that I was trying to track down has to do with how the webserver I'm
using (Apache) is constructing self-referential URLs (e.g., the URL for
the server in redirects), and I'm thinking that this IE problem may have
something to do with it. But, I can't figure out why, and under what
conditions, IE seems to set the "Host:" HTTP header to just <hostname>,
whereas at other times, it seems to set the "Host:" HTTP header to
<hostname>:<port>.

I hope that someone can clarify this...

Thanks,
Jim
 
R

Robert Aldwinckle

ohaya said:
Can someone explain why the Host header would include the
hostname:port# in one case, but only hostname in the other?

I don't think that there is a KB article about this but others have reported
similar observations concerning ports and https requests.


---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top