Adding CORS causes deploy error

Not applicable

I have a hosted target, and I am trying to add CORS headers.

I added them according to this article:

https://docs.apigee.com/api-platform/develop/adding-cors-support-api-proxy#addingcorsheaderstoanexis... and deployed, and the deploy was successful but CORS headers were not sent when trying it out.

I edited the add-cors policy from

<Header name="Access-Control-Allow-Origin">{request.header.origin}</Header>

to

<Header name="Access-Control-Allow-Origin">*</Header>

and while it saved, it would not deploy. I got a generic

Failed to deploy Hosted Function Invalid response returned from backend: failed to update deployment .

I changed it back to {request.header.origin} and I got the same error on deployment.

I've created a new hosted target, using the helloworld sample and clicking on "Add CORS" when the option presents itself, and it deploys initially, and then exhibits the same behavior if I try to edit the origins in the policy, or the allowed methods, even if I edit them back to the original value.

Solved Solved
0 2 140
1 ACCEPTED SOLUTION

I think the error that you see, is unrelated to the change you made.

I think maybe it was a coincidence that your proxy deployment failed.

There may be a problem with the Hosted Targets service. Did you check the status.apigee.com page?

Did you contact support?

View solution in original post

2 REPLIES 2

I think the error that you see, is unrelated to the change you made.

I think maybe it was a coincidence that your proxy deployment failed.

There may be a problem with the Hosted Targets service. Did you check the status.apigee.com page?

Did you contact support?

Not applicable

Thanks for the response, you may be right that it was just a coincidence. I did not check the status page but it seems that I am able to deploy just fine this morning. Thank you for your reply!