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

HTTP Accept header not handled correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Low Low
    • None
    • 1.0
    • None
    • None

      If the Accept header contains any of application/json, application/x-json, text/json, or text/x-json the request will return JSON. This is regardless of the quality or order specified. This does not match the expected behavior based on the spec at http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

      $ curl -v -H 'Accept: application/json' 'https://stash.company.com/projects' 2>&1 | grep ' Content-Type'
      < Content-Type: application/json;charset=UTF-8
      $ curl -v -H 'Accept: text/html' 'https://stash.company.com/projects' 2>&1 | grep ' Content-Type'
      < Content-Type: text/html;charset=UTF-8
      $ curl -v -H 'Accept: text/html, application/json' 'https://stash.company.com/projects' 2>&1 | grep ' Content-Type'
      < Content-Type: application/json;charset=UTF-8
      $ curl -v -H 'Accept: application/json;q=0.5,text/html' 'https://stash.company.com/projects' 2>&1 | grep ' Content-Type'
      < Content-Type: application/json;charset=UTF-8
      $ curl -v -H 'Accept: text/html;q=0.9,application/json;q=0.5' 'https://stash.company.com/projects' 2>&1 | grep ' Content-Type'
      < Content-Type: application/json;charset=UTF-8

              Unassigned Unassigned
              jethomas Jeff Thomas
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: