couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcello Nuccio (JIRA)" <>
Subject [jira] [Commented] (COUCHDB-1175) Improve content type negotiation for couchdb JSON responses
Date Sat, 09 Jul 2011 08:49:16 GMT


Marcello Nuccio commented on COUCHDB-1175:

@Randall, this is almost exactly what I am trying to say.
The only problem is: what to put in the 401 response?

Right now, in CouchDB-1.1, if I do GET for an attachment with content-type 'text/html', the
response could have content-type 'application/json'. This breaks the Couchapps hosted on password
protected DB, because there's no easy way for the browser to get an HTML login page, when
authentication is required.

My solution is: if the client is requesting a 'text/html', give him a 'text/html', even if
the Accept header says that 'application/json' has higher priority.

This does make sense, because it is exactly what I do if authentication is not needed.

> Improve content type negotiation for couchdb JSON responses
> -----------------------------------------------------------
>                 Key: COUCHDB-1175
>                 URL:
>             Project: CouchDB
>          Issue Type: Improvement
>    Affects Versions: 1.0.2
>            Reporter: Robert Newson
>            Assignee: Robert Newson
>            Priority: Blocker
>             Fix For: 1.1.1, 1.2
> Currently we ignore qvalues when negotiation between 'application/json' and 'text/plain'
when returning JSON responses.
> Specifically, we test directly for 'application/json' or 'text/plain' in the Accept header.
Different branches have different bugs, though. Trunk returns 'application/json' if 'application/json'
is present at all, even if it's less preferred than 'text/plain' when qvalues are accounted
> We should follow the standard.

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


View raw message