deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomas Von Veschler (JIRA)" <>
Subject [jira] [Created] (DTACLOUD-53) Wrong content type selected if multiple media types are supplied
Date Thu, 23 Jun 2011 11:50:47 GMT
Wrong content type selected if multiple media types are supplied

                 Key: DTACLOUD-53
             Project: DeltaCloud
          Issue Type: Bug
          Components: Server
            Reporter: Tomas Von Veschler
            Assignee: David Lutterkort
            Priority: Minor

When setting the Accept header as for example: application/json, */* , seems that */* is picked
up and XML content is returned instead of JSON. This doesn't follow the HTTP RFC (

Media ranges can be overridden by more specific media ranges or
   specific media types. If more than one media range applies to a given
   type, the most specific reference has precedence. For example,

       Accept: text/*, text/html, text/html;level=1, */*

   have the following precedence:

       1) text/html;level=1
       2) text/html
       3) text/*
       4) */*

How to test it:

$ curl --url --show-error --header "Accept: application/json,
*/*" -s -v 2>&1 | egrep '(Accept|Content-Type)'
> Accept: application/json, */*
< Content-Type: application/xml;charset=utf-8

$ curl --url --show-error --header "Accept: application/json"
-s -v 2>&1 | egrep '(Accept|Content-Type)'
> Accept: application/json
< Content-Type: application/json;charset=utf-8

This causes problems to all jQuery users, as it sends "Accept:application/json, text/javascript,

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message