[ https://issues.apache.org/jira/browse/COUCHDB-1175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13061808#comment-13061808 ]
Marcello Nuccio commented on COUCHDB-1175: ------------------------------------------ A question: is it needed sending a 302 when login is required? Maybe it is perfectly fine to always send a 401, if we respond with the correct content-type. All attachments in CouchDB have a content-type. Does it make sense to respond with a different content-type for this attachment? For example, if `index.html` has content-type set to `text/html`, is it reasonable to expect a response with this content-type for this attachment? I think yes. So, if I do a GET http://localhost:5984/db/_design/app/page.html, I expect to get a 401 with an HTML login page if authentication is needed, and a 200 with the contents of index.html if no authentication is needed. > Improve content type negotiation for couchdb JSON responses > ----------------------------------------------------------- > > Key: COUCHDB-1175 > URL: https://issues.apache.org/jira/browse/COUCHDB-1175 > 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 for. > We should follow the standard. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira