couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <robert.new...@gmail.com>
Subject Re: Bug parsing Accept header?
Date Fri, 17 Jun 2011 14:38:52 GMT
Hi Marcello,

The current logic for CouchDB 1.1.0 is this;

1) If the client accepts "application/json" then respond with 401 and
content-type "application/json" (i.e, a normal HTTP/REST response.
2) if the client accepts "text/html" then respond with a 302 to the
authentication_redirect url.

This is from couch_httpd:error_headers/4.

I'll note that Futon does not produce login popups under the
conditions you describe but perhaps I failed to reproduce your test
scenario (in Firefox 4.0.1, anyway).

B.

On 17 June 2011 15:23, Marcello Nuccio <marcello.nuccio@gmail.com> wrote:
> Hi Robert, thanks for your help.
>
> The problem I have is: host a couchapp in a password protected DB.
> This is why I need authentication_redirect.
>
> If I understand it correctly, the logic is:
>
>  - if the client accepts "text/html", then respond with "302";
>  - if not, then respond with "401".
>
> What is the difference between
>    Accept: text/html,*/*;q=0.0
> and
>    Accept: text/html,*/*;q=0.1
> ?
>
> I think they should be treated the same way in this use-case.
> What am I missing?
>
> thanks,
>  Marcello
>
> 2011/6/17 Robert Newson <rnewson@apache.org>:
>> Actualy I think it's this d952ac01cb4cd4ae5ceb0c8cc079acf595ff9747,
>> which is part of COUCHDB-1175.
>>
>> I note that I dislike this content-type negotiation quite a lot, no
>> combination appears to satisfy everyone.
>>
>> B.
>>
>> https://issues.apache.org/jira/browse/COUCHDB-1175
>>
>> On 17 June 2011 13:53, Marcello Nuccio <marcello.nuccio@gmail.com> wrote:
>>> Follow-up:
>>>
>>> To make it work like in CouchDB-1.0, I have tried to change Firefox
>>> Accept header.
>>>
>>> From the "about:config" page, I have set "network.http.accept.default" to
>>> "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.0"
>>> from the default
>>> "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
>>>
>>> i.e. I have changed the last character from "8" to "0".
>>>
>>> Now, Firefox is correctly redirected to the login page when accessing
>>> a password protected database.
>>>
>>> Does someone can confirm the same problem?
>>>
>>> Thanks,
>>>  Marcello
>>>
>>
>

Mime
View raw message