diff options
author | Adam Kocoloski <adam@cloudant.com> | 2011-08-15 15:45:15 -0400 |
---|---|---|
committer | Adam Kocoloski <adam@cloudant.com> | 2011-08-15 15:45:15 -0400 |
commit | 6ffe1675dd7b004e48891956a6bdbe32899ce80c (patch) | |
tree | 57326d9a498481e65bb0db38c66daf10896801f1 /couchjs/js/render.js | |
parent | 52ff89ff7996e839b9e2f91fd76184d362a8aeb0 (diff) | |
parent | fdd1a5d0bc48b49b0df5c9217beff9574011283c (diff) |
Merge branch '11554-merge-couchdb-1.1'
Diffstat (limited to 'couchjs/js/render.js')
-rw-r--r-- | couchjs/js/render.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/couchjs/js/render.js b/couchjs/js/render.js index 9dcfbcd6..d207db41 100644 --- a/couchjs/js/render.js +++ b/couchjs/js/render.js @@ -72,7 +72,7 @@ var Mime = (function() { Mime.responseContentType = null; }; - function runProvides(req) { + function runProvides(req, ddoc) { var supportedMimes = [], bestFun, bestKey = null, accept = req.headers["Accept"]; if (req.query && req.query.format) { bestKey = req.query.format; @@ -103,7 +103,7 @@ var Mime = (function() { }; if (bestFun) { - return bestFun(); + return bestFun.call(ddoc); } else { var supportedTypes = mimeFuns.map(function(mf) {return mimesByKey[mf[0]].join(', ') || mf[0]}); throw(["error","not_acceptable", @@ -233,7 +233,7 @@ var Render = (function() { } if (Mime.providesUsed) { - resp = Mime.runProvides(args[1]); + resp = Mime.runProvides(args[1], ddoc); resp = applyContentType(maybeWrapResponse(resp), Mime.responseContentType); } @@ -287,7 +287,7 @@ var Render = (function() { var tail = listFun.apply(ddoc, args); if (Mime.providesUsed) { - tail = Mime.runProvides(req); + tail = Mime.runProvides(req, ddoc); } if (!gotRow) getRow(); if (typeof tail != "undefined") { |