Bug 424712 - Server location needs a slash at the end. r=rnewman

This commit is contained in:
Michal Jaskurzynski 2012-11-12 09:48:26 -08:00
parent 451ff8f738
commit 565345c3a0
3 changed files with 18 additions and 0 deletions

View File

@ -74,6 +74,10 @@ Sync11Service.prototype = {
get serverURL() Svc.Prefs.get("serverURL"),
set serverURL(value) {
if (!value.endsWith("/")) {
value += "/";
}
// Only do work if it's actually changing
if (value == this.serverURL)
return;

View File

@ -0,0 +1,13 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
Cu.import("resource://services-sync/service.js");
function run_test() {
Service.serverURL = "http://example.com/sync";
do_check_eq(Service.serverURL, "http://example.com/sync/");
Service.serverURL = "http://example.com/sync/";
do_check_eq(Service.serverURL, "http://example.com/sync/");
}

View File

@ -67,6 +67,7 @@ skip-if = os == "android"
[test_service_migratePrefs.js]
[test_service_passwordUTF8.js]
[test_service_persistLogin.js]
[test_service_set_serverURL.js]
[test_service_startOver.js]
[test_service_startup.js]
[test_service_sync_401.js]