How to remove CORS

Someone create a Proxy.

I think he use the "ADD CORS" checkbox when he create the proxy.

So I remove the policies ADD CORS.

But when I do the trace, the ADD CORS is still running at the end of the processus.

Is there a way to remove completely this ADD CORS ?

Or is there a way to add something AFTER this ?

Solved Solved
0 7 277
1 ACCEPTED SOLUTION

@Stephane Lajeunesse - when you delete a policy, the proxy saves as a new revision. But the new revision is not deployed. Please confirm if the updated revision is deployed.

View solution in original post

7 REPLIES 7

@Stephane Lajeunesse - when you delete a policy, the proxy saves as a new revision. But the new revision is not deployed. Please confirm if the updated revision is deployed.

@Sai Saran Vaidyanathan Sure I'm on the new revision. But Like I said I found another ADD CORS in a post-Proxy Flow Hook in the shared flows. How I detach only my proxy from this Post_proxy ?

Flow hooks are executed for EVERY proxy that is called. The easy option is to remove it from the flow hook or else have some excludes logic in your Sharedflow that is being called by the flowhook.

For example, lets say your proxy name is "Foo-v1", then in your shared flow that the flow hook is configured can have a condition

<Step>
  <Name>Add-CORS</Name>
  <Condition>apiproxy.name != "Foo-v1"</Condition>
</Step>

So this gets excluded

Great, that's what I was looking for !

I found that the proxy is running a Post-Proxy Flow Hook. Question does Post-Proxy Flow Hook are for ALL the proxy ? or can I remove this shared flows from my Proxy ? thanks

I found that a shared flows is link in the admin/Environment/Flow hook. So I think I can't remove one proxy from this flow hook. It seems that all proxy will use this flow hook. For the Apigee architect.. it will be fun to have in th proxy screen, another TAB Like INFO telling what is linked with this proxy, instead of searching everywhere.

You should be able to see the FH section in the trace. FH stands for flowhook. It tells if it was part of the Flowhook as it executes the policy