[
https://issues.apache.org/jira/browse/COUCHDB-513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jason Davies closed COUCHDB-513.
--------------------------------
Resolution: Invalid
To send headers you need to use the start() function for _list, e.g.
function(head, req) {
start({code:301, headers: { 'Location': 'http://www.google.com/' }});
}
> Unable to redirect from _list function
> --------------------------------------
>
> Key: COUCHDB-513
> URL: https://issues.apache.org/jira/browse/COUCHDB-513
> Project: CouchDB
> Issue Type: Bug
> Components: JavaScript View Server
> Affects Versions: 0.11
> Environment: Mac OS X 10.5.8, Erlang OTP/R12B, CouchDB/0.11.0a9fd42dc1
> Reporter: Zachary Zolton
> Priority: Minor
>
> Define this _list function:
> function(head, req) {
> return {
> 'code': 301,
> 'headers': { 'Location': 'http://www.google.com/' }
> };
> }
> Try to curl it:
> $ curl -i
> 'http://localhost:5984/db/_design/ddoc/_list/test-redirect/some-view?key=%22foo%22'
> HTTP/1.1 200 OK
> Vary: Accept
> Transfer-Encoding: chunked
> Server: CouchDB/0.11.0a9fd42dc1-git (Erlang OTP/R12B)
> Etag: "46014W5JDRLKZF5SECP2D44YH"
> Date: Thu, 24 Sep 2009 22:23:14 GMT
> Content-Type: application/json
> curl: (56) Received problem 2 in the chunky parser
> Here is Jan's take on the user mailing list:
> http://mail-archives.apache.org/mod_mbox/couchdb-user/200909.mbox/%[email protected]%3e
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.