couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r915529 - /couchdb/trunk/test/javascript/couch_http.js
Date Tue, 23 Feb 2010 21:37:12 GMT
Author: davisp
Date: Tue Feb 23 21:37:12 2010
New Revision: 915529

URL: http://svn.apache.org/viewvc?rev=915529&view=rev
Log:
Fix the command line JavaScript test runner.

Thanks to Bob Dionne for the patch.


Modified:
    couchdb/trunk/test/javascript/couch_http.js

Modified: couchdb/trunk/test/javascript/couch_http.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/test/javascript/couch_http.js?rev=915529&r1=915528&r2=915529&view=diff
==============================================================================
--- couchdb/trunk/test/javascript/couch_http.js (original)
+++ couchdb/trunk/test/javascript/couch_http.js Tue Feb 23 21:37:12 2010
@@ -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();
 };



Mime
View raw message