HTTP Accept header not handled correctly

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Low
    • None
    • Affects Version/s: 1.0
    • Component/s: 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

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

              Created:
              Updated:
              Resolved: