GitHub user onders86 opened a pull request:

    https://github.com/apache/camel/pull/1805

    CAMEL-11509 - check for semicolon added to call ContentType.create

    As mentioned in the issue when ContentType.create is called for such cases, 
it breaks HttpProducerContentTypeTest.java.
    if not, the issue is up.
    
    As a workaround issue, simple check is added.
    We may need to check why ContentType.create fails whereas ContentType.parse 
not as @WillemJiang commented on 
https://issues.apache.org/jira/browse/CAMEL-7886
    and fixed in the issue like 
    
    `
    //Check the contentType is valid or not, If not it throws an exception.
    //When ContentType.parse parse method parse 
"multipart/form-data;boundary=---------------------------j2radvtrk",
    //it removes "boundary" from Content-Type; I have to use contentType.create 
method.
    if (contentTypeString != null) {
        // using ContentType.parser for charset
        if (contentTypeString.indexOf("charset") > 0) {
            contentType = ContentType.parse(contentTypeString);
        } else {
            contentType = ContentType.create(contentTypeString);
        }
    }
    `
    
    I will also try to catch up with httpcomponents and revisit the issue.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/onders86/camel CAMEL-11509

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1805.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1805
    
----
commit 3a5551a4188c53bb3b9cce06f64078fb647a7aa5
Author: onders86 <[email protected]>
Date:   2017-07-05T12:33:27Z

    CAMEL-11509 - httpcomponents-core 4.4.6 ContentType.create changed. so use 
ContentType.parse instead

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to