How does apigee work with nested conditions as in the below. Is it the right syntax below?
<Flows> <Flow name="OptionsPreFlight"> <Request/> <Response> <Step> <Name>add-cors</Name> </Step> <Condition>request.verb == "GET"</Condition> </Response> <Condition>request.verb == "OPTIONS"</Condition> </Flow></Flows>
I wanted the condition request.verb == "GET" to be executed for response only and not for request.
How does apigee interpret the above 2 conditions for the Response?
My intention is to add-cors before I send the response to the client. I cannot remove the existing condition for "OPTIONS".
Do we see any error if apigee tries to add a header to the response which is already present in the response headers?
@Yashwanth Koundinya Saraswathibhatla,
Below is the interpretation of the conditions in Apigee for your code.
The options preflight flow is executed when a preflight request with options verb is sent.
The add-cors policy is never executed because the satisfying condition for the outer flow is request verb = options, so the condition defined for the step, request verb=get will never be satisfied.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |