You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2023/05/24 04:28:00 UTC

[jira] [Resolved] (CAMEL-19383) camel-jslt: allowTemplateFromHeader ignores header on subsequent exchanges

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

Claus Ibsen resolved CAMEL-19383.
---------------------------------
    Resolution: Fixed

> camel-jslt: allowTemplateFromHeader ignores header on subsequent exchanges
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-19383
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19383
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 3.20.4, 4.0-M3
>            Reporter: Jacek Szymański
>            Priority: Major
>             Fix For: 3.20.6, 3.21.0, 4.0-RC1, 4.0
>
>
> When allowTemplateFromHeader is set, the endpoint will remember the first header expression that is set and use it for any subsequent exchange, even if it brings a different expression in its header.
> That is:
> {{template.sendBodyAndHeader("direct:start", TEST_BODY,}}
> {{JsltConstants.HEADER_JSLT_STRING, ".foo");}}
> {{template.sendBodyAndHeader("direct:start", TEST_BODY,}}
> {{JsltConstants.HEADER_JSLT_STRING, ".bar");}}
> will both use the expression .foo and the expression .bar will be ignored.
>  
> Also, if resource is set on the URI, it will ignore any expressions from header despite allowTemplateFromHeader, unless it was set on the first exchange, in which case it will be used for all exchanges, even those without the header set.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)