hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mclean, Brendan" <bmcl...@networksolutions.com>
Subject Problem with order of request host header
Date Tue, 15 Apr 2008 15:07:00 GMT
Hi,
 
I'm looking for a workaround to httpclient (3.1) where every request
sent across the wire has the host header as the last and final header
sent.
It seems no matter what order I call
add/setRequestHeader("host","blahh"), the host header is always sent
last.
 
I realize that according to the HTTP spec this shouldn't matter, but
it's causing a problem with a very small minorty of webservers.
 
Example request logs sent with telent:
 
Generated by httpclient:
 
GET /index.asp?PageAction=CARTDETAILS HTTP/1.1
accept:
image/gif,image/x-xbitmap,image/jpeg,image/pjpeg,application/vnd.ms-exce
l,application/vnd.ms-powerpoint,application/msword,application/x-shockwa
ve-flash,*/*
referer: http://www.dieselpro.com/index.asp
accept-language: en-us
ua-cpu: x86
accept-encoding: gzip,deflate
user-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
1.1.4322; InfoPath.1; .NET CLR 2.0.50727)
connection: Keep-Alive
cache-control: no-cache
Cookie: ASPSESSIONIDCQRDRRQD=GCOIKOIBDLGCAIPDGMMNDHOG; __utmc=92942360;
ASPSESSIONIDAQQDRQQC=GMOHGHDCIDGCELGDOJDJKMCK; CustID=44941;
__utma=92942360.414594330.1208266072.1208266072.1208266072.1;
__utmb=92942360;
__utmz=92942360.1208266072.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(n
one)
Host: www.dieselpro.com


HTTP/1.1 400 Bad Request
Date: Tue, 15 Apr 2008 14:10:46 GMT
Server: WebServer 3-9
Content-Length: 4009
Connection: close
Content-Type: text/html
 
--------------------------------
 
Now manually put the host header anywhere but last and send with telnet:
 
GET /index.asp?PageAction=CARTDETAILS HTTP/1.1
accept:
image/gif,image/x-xbitmap,image/jpeg,image/pjpeg,application/vnd.ms-exce
l,application/vnd.ms-powerpoint,application/msword,application/x-shockwa
ve-flash,*/*
referer: http://www.dieselpro.com/index.asp
accept-language: en-us
ua-cpu: x86
accept-encoding: gzip,deflate
user-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
1.1.4322; InfoPath.1; .NET CLR 2.0.50727)
connection: Keep-Alive
cache-control: no-cache
Host: www.dieselpro.com
Cookie: ASPSESSIONIDCQRDRRQD=GCOIKOIBDLGCAIPDGMMNDHOG; __utmc=92942360;
ASPSESSIONIDAQQDRQQC=GMOHGHDCIDGCELGDOJDJKMCK; CustID=44941;
__utma=92942360.414594330.1208266072.1208266072.1208266072.1;
__utmb=92942360;
__utmz=92942360.1208266072.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(n
one)

 
HTTP/1.1 200 OK
Date: Tue, 15 Apr 2008 14:12:44 GMT
Server: WebServer 3-9
Set-Cookie: CustID=44962; expires=Wed, 15-Apr-2009 14:12:44 GMT; path=/
Set-Cookie: ASPSESSIONIDAQQDRQQC=KLBIGHDCLKFGFEKECKFEBMLB; path=/
cache-control: private
Cache-control: private
Connection: close
Content-Type: text/html
X-Powered-By:WebServer
X-Powered-By: ASP.NET
pragma: no-cache


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message