hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Önder Sezgin (JIRA) <j...@apache.org>
Subject [jira] [Commented] (HTTPCORE-476) ContentType.create fails even if it is compatible to a valid content type according to the RFC: https://tools.ietf.org/html/rfc2045#section-5.1
Date Thu, 13 Jul 2017 08:51:00 GMT

    [ https://issues.apache.org/jira/browse/HTTPCORE-476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16085392#comment-16085392
] 

Önder Sezgin commented on HTTPCORE-476:
---------------------------------------

Failed test case;
{code}
    @Test
    public void testCreate() throws Exception {
        final ContentType contentType = ContentType.create("multipart/form-data; boundary=---------------------------j2radvtrk");
        Assert.assertEquals("multipart/form-data", contentType.getMimeType());
        Assert.assertEquals("---------------------------j2radvtrk", contentType.getParameter("boundary"));
    }
{code}

https://github.com/apache/httpcomponents-core/blob/4.4.x/httpcore/src/main/java/org/apache/http/entity/ContentType.java#L189

this line break because ';' char invalidates and fails create method call.
This is expected i guess. So the issue is invalid.
and your explanation validates our ';' character check in camel-http4 component. so what we
did in this PR seems to be reasonable fix;

https://github.com/apache/camel/pull/1805/files#diff-32bfff2daa467de4b89faefab9671c2eR508

Thanks.






> ContentType.create fails even if it is compatible to a valid content type according to
the RFC: https://tools.ietf.org/html/rfc2045#section-5.1
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-476
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-476
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>    Affects Versions: 4.4.6
>         Environment: all
>            Reporter: Önder Sezgin
>             Fix For: 4.4.7
>
>
> ContentType.create fails even if it is compatible to a valid content type according to
the RFC: https://tools.ietf.org/html/rfc2045#section-5.1
> whereas ContentType.parse does not.
> And additionally ContentType.parse can not be called for everything. 
> Because it drops bolded part of such header "multipart/form-data;boundary*=---------------------------j2radvtrk*"



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message