[javascript] fix loadRemote test for JSON_BASE_URL / baseuri matching stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Mon, 28 Mar 2011 17:39:21 +0200
branchstable
changeset 7122 3b0f1c2af20f
parent 7121 c2badb6de3fe
child 7123 bb303290a6cb
[javascript] fix loadRemote test for JSON_BASE_URL / baseuri matching put both url and baseuri() to lowercase since baseuri() might have uppercase characters. Thanks to Florent for spotting this.
web/data/cubicweb.ajax.js
--- a/web/data/cubicweb.ajax.js	Mon Mar 28 16:42:54 2011 +0200
+++ b/web/data/cubicweb.ajax.js	Mon Mar 28 17:39:21 2011 +0200
@@ -283,7 +283,7 @@
  * dictionary, `reqtype` the HTTP request type (get 'GET' or 'POST').
  */
 function loadRemote(url, form, reqtype, sync) {
-    if (!url.toLowerCase().startswith(baseuri())) {
+    if (!url.toLowerCase().startswith(baseuri().toLowerCase())) {
         url = baseuri() + url;
     }
     if (!sync) {