Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-1447

X-Couch-Update-NewRev header is missed if custom headers are specified in response of _update handler

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2, 1.3
    • Fix Version/s: 2.0.0
    • Labels:
      None
    • Environment:

      Apache CouchDB 1.3.0a-a2bea1f-git
      Apache CouchDB 1.2.0a-94e72e7-git

      Description

      {
      "_id": "_design/dump",
      "_rev": "1-74b49af793bd5ce090712f638c3c920e",
      "updates": {
      "doc": "function(doc, req){ return [doc, {headers:

      {'Content-Type': 'text/html'}

      , 'body': '<h1>test</h1>'}]}"
      }
      }

      curl -v -X PUT http://localhost:5984/app%2fdefault/_design/dump/_update/doc/foo

      • About to connect() to localhost port 5984 (#0)
      • Trying 127.0.0.1...
      • connected
      • Connected to localhost (127.0.0.1) port 5984 (#0)
        > PUT /app%2fdefault/_design/dump/_update/doc/foo HTTP/1.1
        > User-Agent: curl/7.24.0 (x86_64-pc-linux-gnu) libcurl/7.24.0 GnuTLS/2.10.5 zlib/1.2.6
        > Host: localhost:5984
        > Accept: /
        >
        < HTTP/1.1 201 Created
        < Server: CouchDB/1.3.0a-a2bea1f-git (Erlang OTP/R15B)
        < Date: Mon, 19 Mar 2012 01:45:20 GMT
        < Content-Type: text/html
        < Content-Length: 13
        <
      • Connection #0 to host localhost left intact
        <h1>test</h1>* Closing connection #0

      {
      "_id": "_design/dump",
      "_rev": "2-f1c20db4fb28846399ab1cecaa9d2f28",
      "updates": {
      "doc": "function(doc, req){ return [doc,

      {'body': '<h1>test</h1>'}

      ]}"
      }
      }

      curl -v -X PUT http://localhost:5984/app%2fdefault/_design/dump/_update/doc/foo

      • About to connect() to localhost port 5984 (#0)
      • Trying 127.0.0.1...
      • connected
      • Connected to localhost (127.0.0.1) port 5984 (#0)
        > PUT /app%2fdefault/_design/dump/_update/doc/foo HTTP/1.1
        > User-Agent: curl/7.24.0 (x86_64-pc-linux-gnu) libcurl/7.24.0 GnuTLS/2.10.5 zlib/1.2.6
        > Host: localhost:5984
        > Accept: /
        >
        < HTTP/1.1 201 Created
        < X-Couch-Update-NewRev: 4-89c1c79a98fc269e474eb64d999a2049
        < Server: CouchDB/1.3.0a-a2bea1f-git (Erlang OTP/R15B)
        < Date: Mon, 19 Mar 2012 01:46:43 GMT
        < Content-Type: text/html; charset=utf-8
        < Content-Length: 13
        <
      • Connection #0 to host localhost left intact
        <h1>test</h1>* Closing connection #0

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kxepal Alexander Shorin
                Reporter:
                kxepal Alexander Shorin
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: