summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2010-02-23 21:37:12 +0000
committerPaul Joseph Davis <davisp@apache.org>2010-02-23 21:37:12 +0000
commitb0c364febdda6e4e0c0cb57d99a2cc2607025a18 (patch)
tree5c452142cd4755db893adf5637480d7ace006c24
parent65044b7d17cacce989d8866f21becfa6a8cc72b7 (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
-rw-r--r--test/javascript/couch_http.js13
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();
};