couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <fdman...@apache.org>
Subject Re: svn commit: r1126332 - /couchdb/trunk/src/couchdb/couch_httpd.erl
Date Mon, 23 May 2011 12:09:01 GMT
On Mon, May 23, 2011 at 12:55 PM, Robert Newson <robert.newson@gmail.com> wrote:
> I filed a ticket (COUCHDB-1175) to track this. I'm concerned about
> changes to multiple branches with no ticket (this is just one example,
> there are others).
>
> This fix seems insufficient to me. Should we find out the q-value of
> 'application/json' and 'text/plain' and use whichever is higher? The
> mere presence of 'application/json' is not sufficient to decide if
> it's prefered.

I don't think there's a serious issue.
The mochiweb request function accepts_content_encoding/1 takes q=0
values into account. So that means if the Accept header is like for
example:

"Accept: text/plain, application/json; q=0"
or
"Accept: text/plain, application/*; q=0, */*; q=1"

 and we call Req:accepts_content_encoding("application/json"), it will
return false for both cases

As for Q values > 0, HTTP spec [1] seems to say that for all values
the client lists with q > 0, the server can decide which one it wants,
not necessarily the one with highest q value.

[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

>
> B.
>
> On 23 May 2011 12:40, Filipe David Manana <fdmanana@apache.org> wrote:
>> On Mon, May 23, 2011 at 7:46 AM, Benoit Chesneau <bchesneau@gmail.com> wrote:
>>>
>>> We should probably merged it in 1.1.x too since it fixes a regression
>>> compared to 1.0.x
>>
>> I haven't tested it, only looked at the diff, but it looks ok to me.
>>
>>>
>>> - benoît
>>>
>>
>>
>>
>> --
>> Filipe David Manana,
>> fdmanana@gmail.com, fdmanana@apache.org
>>
>> "Reasonable men adapt themselves to the world.
>>  Unreasonable men adapt the world to themselves.
>>  That's why all progress depends on unreasonable men."
>>
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Mime
View raw message