I have an angular that sends calls to Apigee. After tracing the calls i can see that a response is returned. However the client does not get the response. I have no idea what i could be missing in this instance.
I have set up CORS correctly on Apigee and can see the options preflight response getting called successfully. The issue really is on the second call, a response is returned but the client receives null data
Please open the Developer Javascript console in browser and check the Network . Please check the response code and if possible post the bundle to look into it further.
On the browser this is what i am getting. No 'Access-Control-Allow-Origin' header is present on the requested resource. Originis therefore not allowed access. i have set up cors correctly. Here are my configurations
<AssignMessage async="false" continueOnError="false" enabled="true" name="Add-CORS"> <DisplayName>Add CORS</DisplayName> <Properties/> <Add> <Headers> <Header name="Access-Control-Allow-Origin">*</Header> <Header name="Access-Control-Allow-Headers">origin, x-requested-with, accept, Authorization, ApiKey, Content-Type, apikey, authorization, content-type,access-control-allow-origin</Header> <Header name="Access-Control-Max-Age">3628800</Header> <Header name="Access-Control-Allow-Methods">GET, OPTIONS</Header> </Headers> </Add> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> <AssignTo createNew="false" transport="http" type="request"/> </AssignMessage>
Here is my proxy endpoint
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ProxyEndpoint name="default"> <Description/> <PreFlow> <Request> </Request> </PreFlow> <Flows> <Flow name="OptionsPreFlight"> <Request/> <Response> <Step> <Name>Add-CORS</Name> </Step> </Response> <Condition>(request.verb == "OPTIONS")</Condition> </Flow> <Flow name="TEST-GET"> <Request> </Request> <Description/> <Response/> <Condition>(proxy.pathsuffix MatchesPath "/v1/**") and (request.verb == "GET")</Condition> </Flow> </Flows> <PostFlow name="PostFlow"> <Request/> <Response/> </PostFlow> <HTTPProxyConnection> <BasePath>/test</BasePath> <VirtualHost>secure</VirtualHost> </HTTPProxyConnection> <RouteRule name="gettests"> <Condition>(proxy.pathsuffix MatchesPath "/v1/test**") and (request.verb == "GET")</Condition> <TargetEndpoint>gettests</TargetEndpoint> </RouteRule> <RouteRule name="testsearch"> <Condition>(proxy.pathsuffix MatchesPath "/v1/testsearch**") and (request.verb == "GET")</Condition> <TargetEndpoint>testsearch</TargetEndpoint> </RouteRule> <RouteRule name="noRoute"> <Condition>request.verb == "OPTIONS"</Condition> </RouteRule> <RouteRule name="default"/> </ProxyEndpoint>
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |