[ 
https://issues.apache.org/jira/browse/COUCHDB-2475?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Shorin closed COUCHDB-2475.
-------------------------------------
    Resolution: Not a Problem

This isn't a problem since it's about content type negotiation. From point of 
API yes, it need to be application/json. However, browsers are don't understand 
this content type (without special plugins) and instead of rendering it will 
ask you to download stuff. That's not user friendly behaviour. 

But this only happens if you made a request with {{Accept: */*}} headers (as 
browsers does). If you explicitly require application/json - CouchDB will 
return it and this is good practise to use specific MIME type in Accept instead 
of wildcard one when you expect something specific.

See also JIRA issues about content type negotiation, there were relevant 
discussions about.

> GET /_active_tasks should use Content-Type: application/json; charset=utf-8
> ---------------------------------------------------------------------------
>
>                 Key: COUCHDB-2475
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2475
>             Project: CouchDB
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Replication
>    Affects Versions: 1.5.1
>            Reporter: Hendy Irawan
>
> Currently {{/_active_tasks}} uses {{Content-Type: text/plain; charset=utf-8}} 
> which is incorrect, should be {{application/json; charset=utf-8}}.
> Affects 1.3.0, 1.5.0.
> {code}
> > curl -v http://localhost:5984/_active_tasks
> * Hostname was NOT found in DNS cache
> *   Trying 127.0.0.1...
> * Connected to localhost (127.0.0.1) port 5984 (#0)
> > GET /_active_tasks HTTP/1.1
> > User-Agent: curl/7.35.0
> > Host: localhost:5984
> > Accept: */*
> > 
> < HTTP/1.1 200 OK
> * Server CouchDB/1.5.0 (Erlang OTP/R16B03) is not blacklisted
> < Server: CouchDB/1.5.0 (Erlang OTP/R16B03)
> < Date: Sat, 22 Nov 2014 05:17:39 GMT
> < Content-Type: text/plain; charset=utf-8
> < Content-Length: 3
> < Cache-Control: must-revalidate
> < 
> []
> * Connection #0 to host localhost left intact
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to