diff options
author | Paul Joseph Davis <davisp@apache.org> | 2010-02-23 21:37:12 +0000 |
---|---|---|
committer | Paul Joseph Davis <davisp@apache.org> | 2010-02-23 21:37:12 +0000 |
commit | b0c364febdda6e4e0c0cb57d99a2cc2607025a18 (patch) | |
tree | 5c452142cd4755db893adf5637480d7ace006c24 /test | |
parent | 65044b7d17cacce989d8866f21becfa6a8cc72b7 (diff) |
Fix the command line JavaScript test runner.
Thanks to Bob Dionne for the patch.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@915529 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r-- | test/javascript/couch_http.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/javascript/couch_http.js b/test/javascript/couch_http.js index f92cf119..5f4716d2 100644 --- a/test/javascript/couch_http.js +++ b/test/javascript/couch_http.js @@ -15,11 +15,15 @@ if(typeof(CouchHTTP) != "undefined") { CouchHTTP.prototype.open = function(method, url, async) { - if(/^\s*http:\/\//.test(url)) { - return this._open(method, url, async); - } else { - return this._open(method, this.base_url + url, async); + if(!/^\s*http:\/\//.test(url)) { + if(/^[^\/]/.test(url)) { + url = this.base_url + "/" + url; + } else { + url = this.base_url + url; + } } + + return this._open(method, url, async); }; CouchHTTP.prototype.setRequestHeader = function(name, value) { @@ -52,6 +56,7 @@ } })(); +CouchDB.urlPrefix = ""; CouchDB.newXhr = function() { return new CouchHTTP(); }; |