How to remove X-Apigee headers "organization" and "environment" from the request ?

We noticed that the following headers are passed to the backend server as part of the request

X-Apigee.Organization
X-Apigee.Environment
X-Apigee.Message-Timeout

Tried to use AssignMessage and JavaScript policy to remove these headers, but could not even list them. So we were unable to remove them before sending the request to the backend. However, they are somehow sent to backend server.

Is there a way to remove these headers before sending the request to the backend ?

0 2 4,218
2 REPLIES 2

You'll just use the AssignMessage policy. It includes a <Remove> element that you can use to remove headers (among other things) from a request or response.

For your case, it would look like the following:

<Remove>
     <Headers>
          <Header name="X-Apigee.Organization"/>
          <Header name="X-Apigee.Environment"/>
          <Header name="X-Apigee.Message-Timeout"/>
     </Headers>
</Remove>

This AssignMessage policy will work.

also, I think it's a known bug that the API Proxy receives these headers. That behavior should go away soon, magically.


This is a little concerning.

Tried to use AssignMessage and JavaScript policy to remove these headers, but could not even list them.

Adding or removing headers is usually a simple job in Apigee Edge. If you're not succeeding with that, then there's something basic amiss.

Also, just a general hint:
When your observed results are different than your expected results, post your code and we can be more helpful. "I tried some things but they didn't work" is hard to diagnose.