Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I set Access-Control-Allow-Origins on Bitbucket Server 5.7

aaron.golub September 13, 2018

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,POST
Access-Control-Allow-Headers: Authorization

 

 

Thanks in advance for any input!

 

 

2 answers

0 votes
dovidw February 6, 2019

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.

0 votes
Mark A.
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 18, 2018

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events