COUCHDB-1563 ensures urlPrefix is set in all ajax requests
diff --git a/script/couch.js b/script/couch.js
index f7099e3..3deb441 100644
--- a/script/couch.js
+++ b/script/couch.js
@@ -400,15 +400,20 @@
   }
 }
 
+CouchDB.proxyUrl = function(uri) {
+  if(uri.substr(0, CouchDB.protocol.length) != CouchDB.protocol) {
+    uri = CouchDB.urlPrefix + uri;
+  }
+  return uri;
+}
+
 CouchDB.request = function(method, uri, options) {
   options = typeof(options) == 'object' ? options : {};
   options.headers = typeof(options.headers) == 'object' ? options.headers : {};
   options.headers["Content-Type"] = options.headers["Content-Type"] || options.headers["content-type"] || "application/json";
   options.headers["Accept"] = options.headers["Accept"] || options.headers["accept"] || "application/json";
   var req = CouchDB.newXhr();
-  if(uri.substr(0, CouchDB.protocol.length) != CouchDB.protocol) {
-    uri = CouchDB.urlPrefix + uri;
-  }
+  uri = CouchDB.proxyUrl(uri);
   req.open(method, uri, false);
   if (options.headers) {
     var headers = options.headers;
diff --git a/script/test/changes.js b/script/test/changes.js
index 33b3af9..d76c193 100644
--- a/script/test/changes.js
+++ b/script/test/changes.js
@@ -78,7 +78,7 @@
     // WebKit (last checked on nightly #47686) does fail on processing
     // the async-request properly while javascript is executed.
 
-    xhr.open("GET", "/test_suite_db/_changes?feed=continuous&timeout=500", true);
+    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&timeout=500"), true);
     xhr.send("");
 
     var docBar = {_id:"bar", bar:1};
@@ -122,7 +122,7 @@
     xhr = CouchDB.newXhr();
 
     //verify the hearbeat newlines are sent
-    xhr.open("GET", "/test_suite_db/_changes?feed=continuous&heartbeat=10&timeout=500", true);
+    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&heartbeat=10&timeout=500"), true);
     xhr.send("");
 
     var str;
@@ -169,7 +169,7 @@
     // test longpolling
     xhr = CouchDB.newXhr();
 
-    xhr.open("GET", "/test_suite_db/_changes?feed=longpoll", true);
+    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=longpoll"), true);
     xhr.send("");
 
     waitForSuccess(function() {
@@ -181,7 +181,7 @@
 
     xhr = CouchDB.newXhr();
 
-    xhr.open("GET", "/test_suite_db/_changes?feed=longpoll&since=3", true);
+    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=longpoll&since=3"), true);
     xhr.send("");
 
     var docBarz = {_id:"barz", bar:1};
@@ -300,13 +300,13 @@
     // filter with longpoll
     // longpoll filters full history when run without a since seq
     xhr = CouchDB.newXhr();
-    xhr.open("GET", "/test_suite_db/_changes?feed=longpoll&filter=changes_filter/bop", false);
+    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=longpoll&filter=changes_filter/bop"), false);
     xhr.send("");
     var resp = JSON.parse(xhr.responseText);
     T(resp.last_seq == 8);
     // longpoll waits until a matching change before returning
     xhr = CouchDB.newXhr();
-    xhr.open("GET", "/test_suite_db/_changes?feed=longpoll&since=8&filter=changes_filter/bop", true);
+    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=longpoll&since=7&filter=changes_filter/bop"), true);
     xhr.send("");
     db.save({"_id":"falsy", "bop" : ""}); // empty string is falsy
     db.save({"_id":"bingo","bop" : "bingo"});
@@ -325,7 +325,7 @@
 
       // filter with continuous
       xhr = CouchDB.newXhr();
-      xhr.open("GET", "/test_suite_db/_changes?feed=continuous&filter=changes_filter/bop&timeout="+timeout, true);
+      xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&filter=changes_filter/bop&timeout="+timeout), true);
       xhr.send("");
 
       db.save({"_id":"rusty", "bop" : "plankton"});
@@ -518,7 +518,7 @@
     if (!is_safari && xhr) {
         // filter docids with continuous
         xhr = CouchDB.newXhr();
-        xhr.open("POST", "/test_suite_db/_changes?feed=continuous&timeout=500&since=7&filter=_doc_ids", true);
+        xhr.open("POST", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&timeout=500&since=7&filter=_doc_ids"), true);
         xhr.setRequestHeader("Content-Type", "application/json");
 
         xhr.send(options.body);
@@ -612,4 +612,3 @@
   // cleanup
   db.deleteDb();
 };
-
diff --git a/script/test/content_negotiation.js b/script/test/content_negotiation.js
index 5778fad..36e7dfb 100644
--- a/script/test/content_negotiation.js
+++ b/script/test/content_negotiation.js
@@ -19,7 +19,7 @@
 
   // with no accept header
   var req = CouchDB.newXhr();
-  req.open("GET", "/test_suite_db/", false);
+  req.open("GET", CouchDB.proxyUrl("/test_suite_db/"), false);
   req.send("");
   TEquals("text/plain; charset=utf-8", req.getResponseHeader("Content-Type"));
 
diff --git a/verify_install.html b/verify_install.html
index 1806adf..388833b 100644
--- a/verify_install.html
+++ b/verify_install.html
@@ -45,6 +45,7 @@
     }
 
     function tests() {
+      CouchDB.urlPrefix = "..";
       var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
 
       // cleanup, ignore the 404