Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location header not returned after mergePullRequest #103

Open
mattiaerli97 opened this issue Jul 9, 2021 · 1 comment
Open

Location header not returned after mergePullRequest #103

mattiaerli97 opened this issue Jul 9, 2021 · 1 comment

Comments

@mattiaerli97
Copy link

I have to merge a pull request and get the "Location" header so I can retrieve the correct task-status using Bitbucket API.
However, when I merge a pull request, after a success code is returned (merge works correctly), I don't receive the expected header. In particular, performing the call reported below:

state.bb.repositories
        .mergePullRequest({
          workspace: WORKSPACE,
          repo_slug: data.slug,
          pull_request_id: data.pr_id,
          async: true,
        })
        .then(({ resp, headers }) => {
          console.log(headers)
        })

In the console.log used in the promise function, I receive the following headers:

cache-control: "no-cache, no-store, must-revalidate, max-age=0"
content-length: "2"
content-type: "application/json; charset=utf-8"
expires: "Fri, 09 Jul 2021 14:27:22 GMT"

So no "Location" header is returned.
Can you please explain me why or/and the correct syntax to get the "Location" header? Thanks a lot

@MunifTanjim
Copy link
Owner

If you make the request directly to this API: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/merge#post
does it returns the Location header? I know it's written the their documentation. But in many case those documentations are not correct or not up-to-date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants