Github user nickva commented on the issue:

    https://github.com/apache/couchdb-chttpd/pull/151
  
    +1
    
    ```
    In [15]: fun2 = '''function(doc, req){ return [doc, {headers:
        ...: {'Content-Type': 'text/blah'}
        ...:
        ...: , 'body': '<h1>test</h1>'}]}'''
    
    In [16]: doc2 = {"updates": {"doc":fun2}}
    
    In [17]: d['_design/dump2'] = doc2
    ```
    
    then saw custom header and NewRev
    
    ```
     curl -v -X PUT http://localhost:15984/d/_design/dump2/_update/doc/foo
    *   Trying ::1...
    * connect to ::1 port 15984 failed: Connection refused
    *   Trying 127.0.0.1...
    * Connected to localhost (127.0.0.1) port 15984 (#0)
    > PUT /d/_design/dump2/_update/doc/foo HTTP/1.1
    > Host: localhost:15984
    > User-Agent: curl/7.43.0
    > Accept: */*
    >
    < HTTP/1.1 201 Created
    < Content-Length: 13
    < Content-Type: text/blah
    < Date: Thu, 01 Dec 2016 15:46:30 GMT
    < Server: CouchDB/2.0.0-d9b51a0 (Erlang OTP/18)
    < X-Couch-Id: foo
    < X-Couch-Request-ID: 549d61e9e7
    < X-Couch-Update-NewRev: 3-825cb35de44c433bfb2df415563a19de
    < X-CouchDB-Body-Time: 0
    <
    * Connection #0 to host localhost left intact
    <h1>test</h1>
    ```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to