I am getting “The ‘Access-Control-Allow-Origin’ header contains multiple values ‘*, *’, but only one is allowed.” type of error when requesting an API via ApiGee.
Instead of using Add to set the Access-Control-Allow-Origin header, use Set. Since headers can support multiple values, Add will add one, rather than just setting the existing. Set will ensure that if there is already a header there you aren’t doubling it up.
Actually this is odd.. I went as far as to add an assign message policy that REMOVEd all the CORS headers and then SET them, because I thought they might be coming in from the backend service.. It is still broken in Chrome, which reports it as “*, *”, but when I curl it I see below
definition of the policy of raisefull, where we will indicate the headers of Access-Control-Allow-Origin with * that will allow the invocation from our browser
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
OPTIONS CORS Headers Response
*
origin, x-requested-with, accept, ucsb-api-key, ucsb-api-version, authorization
3628800
GET, PUT, POST, DELETE
200
OK
true
hi Carlos Eberhardt / @venkatesh can you please give an example on what you meant by Instead of using Add to set the Access-Control-Allow-Origin header, use Set.