The revision is deployed, but traffic cannot flow.

Not applicable

I'm getting this message with further error information as follows:

 Variable at index : 18 is must be enclosed with in { and }.

It doesn't say line 18 of what, but probably it's my Assign Message policy. That said, line 18 is not very interesting:

<AssignTo createNew="false" transport="http" type="request"/>

I suspect the problem has arisen because I have a header that includes special characters (< and >). When I include those special characters directly it fails to save. When I escape them with &lt; and &gt; it saves but then gives this runtime error.

Unfortunately in my case the backend server requires a custom authorization header and the secret includes special characters. So what I would like to do is something like this:

<Header name="Authorization">Custom #############</Header>

With the ### replaced by some ordinary characters and some special characters. Is this possible?

0 2 351
2 REPLIES 2

Former Community Member
Not applicable

Hi @sgreene you should be able to send a custom header to the backend service. Can you share the actual header that you are trying to send to the backend? You would need to escape characters such as <, > & {, } as they are reserved.

@sgreene

The escaping issue may be only because you are trying to use those characters in an XML file. You can try to set a variable in a previous step (maybe using JavaScript) and then use the variable in your AssignMessage:

<Header name="Authorization">Custom {authValue}</Header>

Or set the header itself using JavaScript:

context.setVariable("request.header.Authorization", "Custom abc<def>ghi");