Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 3351 invoked from network); 28 May 2002 00:28:17 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 28 May 2002 00:28:17 -0000 Received: (qmail 28408 invoked by uid 97); 28 May 2002 00:28:22 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 28356 invoked by uid 97); 28 May 2002 00:28:21 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 28344 invoked by uid 98); 28 May 2002 00:28:21 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: <11D958C3B4AFD411ACD40008C709AE20023D9C6A@wnmmx01.synergy.co.nz> From: Aleksandar Maricic To: "'commons-dev@jakarta.apache.org'" Subject: [commons-sandbox-http] BrowserDetector.java patch for programmati c HTTP clients Date: Tue, 28 May 2002 12:31:08 +1200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2655.55) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C205DE.F60CD570" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------_=_NextPart_000_01C205DE.F60CD570 Content-Type: text/plain; charset="iso-8859-1" Hello, we have found that commons-sandbox-http org.apache.commons.http.BrowserDetector needs a simple sanity check to prevent its falling over with a StringIndexOutOfBoundsException when pages are retrieved from a programmatic HTTP client that reports its User-Agent header string as "Java1.3.1" A patch to the current version (1.1) is attached - I hope someone with commit privileges could spare a few minutes to make it a part of the official source. Thanks, Aleks Maricic <> ------_=_NextPart_000_01C205DE.F60CD570 Content-Type: application/octet-stream; name="BrowserDetector.java.patch" Content-Disposition: attachment; filename="BrowserDetector.java.patch" 209c209,219 < browserName = userAgentString.substring(0, versionStartIndex); --- > // Prevent the method from falling over with StringIndexOutOfRangeEx > // if there is no "/" in the userAgentString > if (versionStartIndex != -1) > { > browserName = userAgentString.substring(0, versionStartIndex); > } > else > { > // this is probably some programmatic HTTP client such as Java1.3. > browserName = userAgentString; > } ------_=_NextPart_000_01C205DE.F60CD570 Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: ------_=_NextPart_000_01C205DE.F60CD570--