Return-Path: Delivered-To: apmail-jakarta-httpcomponents-dev-archive@www.apache.org Received: (qmail 59331 invoked from network); 28 Jun 2007 15:24:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jun 2007 15:24:49 -0000 Received: (qmail 23483 invoked by uid 500); 28 Jun 2007 15:24:51 -0000 Delivered-To: apmail-jakarta-httpcomponents-dev-archive@jakarta.apache.org Received: (qmail 23458 invoked by uid 500); 28 Jun 2007 15:24:51 -0000 Mailing-List: contact httpcomponents-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list httpcomponents-dev@jakarta.apache.org Received: (qmail 23445 invoked by uid 99); 28 Jun 2007 15:24:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 08:24:51 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 08:24:47 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 90C75714062 for ; Thu, 28 Jun 2007 08:24:27 -0700 (PDT) Message-ID: <10487456.1183044267588.JavaMail.jira@brutus> Date: Thu, 28 Jun 2007 08:24:27 -0700 (PDT) From: "Roland Weber (JIRA)" To: httpcomponents-dev@jakarta.apache.org Subject: [jira] Commented: (HTTPCLIENT-660) Should host header be send in all lowercase In-Reply-To: <7424481.1182973826090.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCLIENT-660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508856 ] Roland Weber commented on HTTPCLIENT-660: ----------------------------------------- That sounds like a case for an optional request interceptor. > Should host header be send in all lowercase > ------------------------------------------- > > Key: HTTPCLIENT-660 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-660 > Project: HttpComponents HttpClient > Issue Type: Improvement > Affects Versions: 3.1 RC1 > Environment: Windows XP > Sun 1.6_01 JVM > Reporter: Daniel Hopper > Priority: Minor > Fix For: 4.0 Alpha 1 > > > Current the host header is sent as is from any 302 or standard url request. Now obviously according to the spec host names should be compared case insensitive but this isn't always the case. Most if not all browser will always lowercase the domain names when a request is sent. This problem happened when we were trying to valid urls from merchants. The one in particular was > http://www.jdoqocy.com/click-1916095-10274762 > which will finally end up redirecting to > http://www.BestArt.com/default.asp?aff=1 > With that case in the domain name and that is the way the host header is written. This will actually return a 404 if you request this URL from commons-httpclient, but will give no problem with a request in IE or FireFox b/c they lowercase the domain name before sending. This is b/c its trying to match BestArt instead of bestart. Now I know this isn't a problem with commons-httpclient but rather how they have their server configured. I think it would be nice to provide a property for this configuration settting or rather follow the way all browsers handle this as well. > I know this isn't a major issue and was able to get around it by just sub classing the GetMethod and overriding addRequestHeader. > @Override > public void addRequestHeader(Header header) { > if(header.getName().equalsIgnoreCase("host")) { > header = new Header(header.getName(), header.getValue().toLowerCase(), header.isAutogenerated()); > } > super.addRequestHeader(header); > } > Just thought this may be of interest as well as it is quite a simple fix. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org