Bitbucket Server throws error when tries to fetch a raw json with Accept: application/json

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 5.2.0, 5.3.1
    • Component/s: API - REST
    • None
    • 2
    • Severity 3 - Minor
    • 2

      Summary

      Bitbucket Server throws error when tries to fetch a raw json with Accept header (Content-type: application/json) specified

      Steps to Reproduce

      curl -H "Accept: application/json" -H "Content-type: application/json" -X GET https://<URL>/projects/<project>/repos/<repo>/raw/file.json

      Expected Results

      It returns the raw contents of the file.

      Actual Results

      For versions before 5.3.0, this returns 

      {"message":"null for uri: https://<URL>/projects/<project>/repos/<repo>/raw/file.json","status-code":404} 
      

      and for versions 5.3.0+, this returns

      {"message":"null for uri: https://<URL>/projects/<project>/repos/<repo>/raw/file.json","status-code":500}
      

      Workaround

      Replace https://<URL>/projects/<project>/repos/<repo>/raw/file.json with

      https://<URL>/mvc/projects/<project>/repos/<repo>/raw/file.json

              Assignee:
              Unassigned
              Reporter:
              Prasanth
              Votes:
              6 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: