You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/09/24 08:42:37 UTC
svn commit: r1627233 - in /ofbiz/branches/release12.04: ./
framework/base/src/org/ofbiz/base/util/HttpClient.java
Author: jleroux
Date: Wed Sep 24 06:42:37 2014
New Revision: 1627233
URL: http://svn.apache.org/r1627233
Log:
"Applied fix from trunk for revision: 1627230 "
------------------------------------------------------------------------
r1627230 | jleroux | 2014-09-24 08:40:46 +0200 (mer. 24 sept. 2014) | 11 lignes
A patch from Leon for "HttpClient does not support charset name with quotation mark around" https://issues.apache.org/jira/browse/OFBIZ-5787
In RFC2045 (Section 5.1) there is:
"Content-type: text/plain; charset=us-ascii (Plain text)
Content-type: text/plain; charset="us-ascii"
are completely equivalent".
In current revision, if the 'Content-Type' of http response includes the quotation mark around the charset name, HttpClient throws out unsupported encoding exception.
This patch removes quotation marks from charset name extracted from http response header.
------------------------------------------------------------------------
Modified:
ofbiz/branches/release12.04/ (props changed)
ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/HttpClient.java
Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
Merged /ofbiz/trunk:r1627230
Modified: ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/HttpClient.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/HttpClient.java?rev=1627233&r1=1627232&r2=1627233&view=diff
==============================================================================
--- ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/HttpClient.java (original)
+++ ofbiz/branches/release12.04/framework/base/src/org/ofbiz/base/util/HttpClient.java Wed Sep 24 06:42:37 2014
@@ -373,7 +373,7 @@ public class HttpClient {
charset = contentType.substring(charsetEqualsLoc + 1);
}
- if (charset != null) charset = charset.trim();
+ if (charset != null) charset = charset.trim().replaceAll("\"", "");
if (Debug.verboseOn() || debug) Debug.logVerbose("Getting text from HttpClient with charset: " + charset, module);
}