Trying to access the following from another server on our network:
GET https://bitbucket.*****.com:8443/rest/api/1.0/projects/<project>/repos/<repo>/branches?filterText=<filter>&limit=1000
This is the response I get:
Failed to load https://bitbucket.*******.com:8443/rest/api/1.0/projects/LAM/repos/trigger_every_5_min/branches?filterText=feature/&limit=1000: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
How do I set the following on Bitbucket server:
Access-Control-Allow-Origins: *Access-Control-Allow-Methods: GET,PUT,OPTIONS,POSTAccess-Control-Allow-Headers: Authorization
Thanks in advance for any input!
It appears you are hitting an XSRF security issue in which it is failing to acquire a token from the server. You can opt-out of this by providing the following in your curl call:
X-Atlassian-Token: no-check
It doesn't seem like Bitbucket comes with the option for cors headers.
I guess the best option is to stand up an nginx (or apache) sever in the middle and use is as a reverse proxy.
It looks like you're new here. Sign in or register to get started.