diff options
author | John Christopher Anderson <jchris@apache.org> | 2010-02-25 01:20:07 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2010-02-25 01:20:07 +0000 |
commit | 16577da96d0cb43b7733a3a04c21aa9ac72bdb64 (patch) | |
tree | 6272012e5de13625259894bc699d568a1a3cb90b /share/server/render.js | |
parent | 4bc9bfa958d7107e2667cde9d671fd189301d4bf (diff) |
commonjs require for show list etc via Mikeal Rogers. closes COUCHDB-658
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@916076 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/server/render.js')
-rw-r--r-- | share/server/render.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/share/server/render.js b/share/server/render.js index 1e341ec7..9dcfbcd6 100644 --- a/share/server/render.js +++ b/share/server/render.js @@ -210,6 +210,11 @@ var Render = (function() { return s; }; + function isDocRequestPath(info) { + var path = info.path; + return path.length > 5; + }; + function runShow(fun, ddoc, args) { try { resetList(); @@ -239,7 +244,7 @@ var Render = (function() { throw(["error", "render_error", "undefined response from show function"]); } } catch(e) { - if(args[0] === null) { + if (args[0] === null && isDocRequestPath(args[1])) { throw(["error", "not_found", "document not found"]); } else { renderError(e, fun.toSource()); |