Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-4026

Switching branches in file view causes internal error with branch names containing a "/"

    XMLWordPrintable

Details

    Description

      We use branch names of the form:

      <product>/<version>

      This works fine in git, and up until now every place in Stash I've tried. There does appear to be a problem when switching branches in the file viewer:

      If I view the version of a file on the master branch and then switch to the proj/1-0-0 branch I get a "Something went wrong while trying to serve your request. Try reloading the page.". Reloading the page works and correctly shows the head version on the proj/1-0-0 branch.

      Some notes:

      I ran a live http request viewer and I noticed that clicking the branch name in the selector produces the following REST query:

      http://<OUR SERVER>/rest/api/latest/projects/PROJ/repos/utils/commits/proj%2F1-0-0?path=modules&avatarSize=32

      I'd imagine the %2F is the problem here as I don't think the branch name should be url encoded in the REST query body (that should just be a "/").

      Doing a reload means its a new page query with the url:

      http://<OUR SERVER>/projects/PROJ/repos/utils/browse/modules?at=refs%2Fheads%2Fproj%2F1-0-0

      In this case the branch is going in as a parameter value where it should be URL encoded and so the page loads fine.

      This is a right pain for us and makes the file viewer far more awkward to use when moving between branches.

      Attachments

        Issue Links

          Activity

            People

              jhinch jhinch (Atlassian)
              andrew.milne1 andrew.milne1
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: