[
https://issues.apache.org/jira/browse/HTTPCLIENT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Oleg Kalnichevski resolved HTTPCLIENT-880.
------------------------------------------
Resolution: Fixed
Fix Version/s: (was: 4.0.1)
Fixed in SVN trunk. Please review
Oleg
> Check for correct content-type in URLEncodedUtils not working for
> encoding-suffixes
> -----------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-880
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-880
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.0 Final
> Reporter: Andreas Eternach
> Priority: Minor
> Fix For: 4.1.0
>
>
> Dear DEV-Team,
> i am developing an application with the httpclient. Today i found a small
> problem, related to URLEncodedUtils.
> Our Tomcat-Server deliveres for Server-Requests, the HTTP-Header:
> "Content-Type=application/x-www-form-urlencoded;charset=UTF-8", but the
> httpclient only checks for: "Content-Type=application/x-www-form-urlencoded".
> This failing check results in an empty result of call to the method:
> URLEncodedUtils.parse(entity);
> Following source-code causes the prob:
> public class URLEncodedUtils {
> /**
> * Returns true if the entity's Content-Type header is
> * <code>application/x-www-form-urlencoded</code>.
> */
> public static boolean isEncoded (final HttpEntity entity) {
> final Header contentType = entity.getContentType();
> return (contentType != null &&
> contentType.getValue().equalsIgnoreCase(CONTENT_TYPE));
> }
> }
> IMO the method should be changed to:
> public class URLEncodedUtils {
> /**
> * Returns true if the entity's Content-Type header is
> * <code>application/x-www-form-urlencoded</code>.
> */
> public static boolean isEncoded (final HttpEntity entity) {
> final Header contentType = entity.getContentType();
> return (contentType != null &&
> contentType.getValue().startsWith(CONTENT_TYPE + ";"));
> }
> }
> Best Regards,
--
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: [email protected]
For additional commands, e-mail: [email protected]