views:

77

answers:

1

Say I make an HTTP request to: foosite.com but the port I actually send the request to is 6103 but I DON'T put that port in the "Host" header for example:

GET /barpage HTTP/1.1
Host: foosite.com
Method: GET

Should the server then recognize that I'm trying to talk to it on port 6103? Or since it was omitted in the request am I gambling on if the server actually recognizes this?

I ask that question to say this: I've found that browsers, at least firefox + chrome, put the port int he "Host" header. But the Java app I'm using does not. And when the port is not passed in the "Host" the server responds back thinking I'm on port 80. So who do I need to badger? The server operator, or the Java programmer?

+2  A: 

See section 14.23 of the HTTP spec which specifies that the port # should be included if its not the default port of 80.

superfell
Yeah I read that in the RFC as well. I probably should have noted that. I was hoping for someone to say something knowledgeable in the sense of knowing specifically how certain web servers and web app frameworks react to this kind of request like: "Some web servers / app frameworks handle it, but X and Y don't" etc etc. Ultimately I expected to just accept what the RFC had to say, but I'm going to give this question maybe a day before I give up.
Revoked