[jira] Created: (HTTPCLIENT-880) Check for correct content-type in URLEncodedUtils not working for encoding-suffixes

View: New views
4 Messages — Rating Filter:   Alert me  

[jira] Created: (HTTPCLIENT-880) Check for correct content-type in URLEncodedUtils not working for encoding-suffixes

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 Beta 2
            Reporter: Andreas Eternach


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: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Updated: (HTTPCLIENT-880) Check for correct content-type in URLEncodedUtils not working for encoding-suffixes

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/HTTPCLIENT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCLIENT-880:
-----------------------------------------

             Priority: Minor  (was: Major)
    Affects Version/s:     (was: 4.0 Beta 2)
                       4.0 Final
        Fix Version/s: 4.1.0
                       4.0.1

Yeah. Fair enough. I'll get it fixed.

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.0.1, 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: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Resolved: (HTTPCLIENT-880) Check for correct content-type in URLEncodedUtils not working for encoding-suffixes

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ 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: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Closed: (HTTPCLIENT-880) Check for correct content-type in URLEncodedUtils not working for encoding-suffixes

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/HTTPCLIENT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Eternach closed HTTPCLIENT-880.
---------------------------------------


> 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: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...