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
Родитель b2ba5959ec
Коммит fc42a78b29
3 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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/");
}

Просмотреть файл

@ -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]