diff options
author | Alex Zolotarev <alex@mapswithme.com> | 2013-07-01 03:25:36 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:57:47 +0300 |
commit | 33e27e5f2437cb9f02b88a7168948e36c7db08ee (patch) | |
tree | 0a19406a3d4c43f12e8f4e8a1d703c446224f3ac /map | |
parent | f2ca69f7766ef22de71741f2ac579093b915df33 (diff) |
[api] Fixed back urls without ://
Diffstat (limited to 'map')
-rw-r--r-- | map/map_tests/mwm_url_tests.cpp | 6 | ||||
-rw-r--r-- | map/mwm_url.cpp | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/map/map_tests/mwm_url_tests.cpp b/map/map_tests/mwm_url_tests.cpp index 0bc8c1a9f7..dd2ecdb0e4 100644 --- a/map/map_tests/mwm_url_tests.cpp +++ b/map/map_tests/mwm_url_tests.cpp @@ -96,6 +96,10 @@ UNIT_TEST(MapApiPointURLEncoded) UNIT_TEST(GlobalBackUrl) { { + ParsedMapApi api(Uri("mwm://map?ll=1,2&n=PointName&backurl=someTestAppBackUrl")); + TEST_EQUAL(api.GetGlobalBackUrl(), "someTestAppBackUrl://", ()); + } + { ParsedMapApi api(Uri("mwm://map?ll=1,2&n=PointName&backurl=ge0://")); TEST_EQUAL(api.GetGlobalBackUrl(), "ge0://", ()); } @@ -125,7 +129,7 @@ UNIT_TEST(GlobalBackUrl) } { ParsedMapApi api(Uri("mwm://map?ll=1,2&n=PointName&backurl=%E6%88%91%E6%84%9Bmapswithme")); - TEST_EQUAL(api.GetGlobalBackUrl(), "我愛mapswithme", ()); + TEST_EQUAL(api.GetGlobalBackUrl(), "我愛mapswithme://", ()); } } diff --git a/map/mwm_url.cpp b/map/mwm_url.cpp index 220555374b..e7bd3b84f4 100644 --- a/map/mwm_url.cpp +++ b/map/mwm_url.cpp @@ -116,7 +116,11 @@ void ParsedMapApi::AddKeyValue(string key, string const & value) } else if (key == "backurl") { - m_globalBackUrl = value; + // Fix missing :// in back url, it's important for iOS + if (value.find("://") == string::npos) + m_globalBackUrl = value + "://"; + else + m_globalBackUrl = value; } else if (key == "v") { |