You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by zregvart <gi...@git.apache.org> on 2017/03/29 12:57:26 UTC

[GitHub] camel pull request #1580: CAMEL-11092 If setting Exchange.REST_HTTP_URI the ...

GitHub user zregvart opened a pull request:

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

    CAMEL-11092 If setting Exchange.REST_HTTP_URI the RestProducer should remove Exchange.HTTP_PATH header

    As most HTTP components generate URIs by concatenating `Exchange.REST_HTTP_URI` and `Exchange.HTTP_PATH` when the REST producer generates `Exchange.REST_HTTP_URI` header that contains the whole URI to be used it should remove the `Exchange.HTTP_PATH` header in order to
    prevent incorrect URIs.
    
    For example `Exchange.HTTP_PATH` is set by the REST consumer to `/api/pet/123`, and REST producer is configured with `Exchange.REST_HTTP_URI` with URI `/api/pet/{petId}` if the `Exchange.HTTP_PATH` is not removed HTTP component (IMHO all except for Restlet) would try to send the request to `/api/pet/{petId}/api/pet/123`

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

    $ git pull https://github.com/zregvart/camel CAMEL-11092

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

    https://github.com/apache/camel/pull/1580.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 #1580
    
----
commit 496280c61c1642a619771e8b27e4329a9c84ca2c
Author: Zoran Regvart <zr...@apache.org>
Date:   2017-03-29T12:55:57Z

    CAMEL-11092 If setting Exchange.REST_HTTP_URI t...
    
    ...he RestProducer should remove Exchange.HTTP_PATH header
    
    As most HTTP components generate URIs by concatenating
    `Exchange.REST_HTTP_URI` and `Exchange.HTTP_PATH` when the REST producer
    generates `Exchange.REST_HTTP_URI` header that contains the whole URI to
    be used it should remove the `Exchange.HTTP_PATH` header in order to
    prevent incorrect URIs.
    
    For example `Exchange.HTTP_PATH` is set by the REST consumer to
    `/api/pet/123`, and REST producer is configured with
    `Exchange.REST_HTTP_URI` with URI `/api/pet/{petId}` if the
    `Exchange.HTTP_PATH` is not removed HTTP component (IMHO all except for
    Restlet) would try to send the request to `/api/pet/{petId}/api/pet/123`

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] camel pull request #1580: CAMEL-11092 If setting Exchange.REST_HTTP_URI the ...

Posted by zregvart <gi...@git.apache.org>.
Github user zregvart closed the pull request at:

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---