Feature Request: Add CORS support to the 1.1 API

api

#1

Hi folks,

Would it be possible for the OPTIONS requests (and the POST request?) to

https://circleci.com/api/v1.1/project/github/username/project-name/tree/branch?circle-token=...

support proper CORS headers? I can see the request being received by Circle and properly creating a build, but Chrome rejects the response.

A side note. I don’t understand why, yet, exactly, but the request does not require a pre-flight OPTIONS request if the body is empty. However, the moment I start including data, Chrome will attempt to create a pre-flight OPTIONS request and not send the actual post.

When include data, I get the following console errors

OPTIONS https://circleci.com/api/v1.1/project/github/username/github/tree/project?circle-token=... 404 (Not Found) [stack trace]

Failed to load https://circleci.com/api/v1.1/project/github/username/github/tree/project?circle-token=...: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3003' is therefore not allowed access. The response had HTTP status code 404.

Without a body, I only get the second error message.

Thank you for everything! Circle is indispensable!

-R


#2

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.