diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index d92577aebe..df4cf4d2bf 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -103,7 +103,7 @@ public class PlacePageView extends RelativeLayout private static final String PREF_USE_DMS = "use_dms"; //TODO: remove this after booking_api.cpp will be done - private static final boolean USE_OLD_BOOKING = true; + private static final boolean USE_OLD_BOOKING = false; private boolean mIsDocked; private boolean mIsFloating; diff --git a/android/src/com/mapswithme/util/HttpClient.java b/android/src/com/mapswithme/util/HttpClient.java index e49c484743..39556515ef 100644 --- a/android/src/com/mapswithme/util/HttpClient.java +++ b/android/src/com/mapswithme/util/HttpClient.java @@ -45,6 +45,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.zip.GZIPInputStream; public final class HttpClient { @@ -201,7 +202,10 @@ public final class HttpClient InputStream in; try { - in = connection.getInputStream(); + if ("gzip".equals(connection.getContentEncoding())) + in = new GZIPInputStream(connection.getInputStream()); + else + in = connection.getInputStream(); } catch (IOException e) { diff --git a/platform/http_client.cpp b/platform/http_client.cpp index cda1229cd1..b4c63faba1 100644 --- a/platform/http_client.cpp +++ b/platform/http_client.cpp @@ -8,6 +8,11 @@ namespace platform { +HttpClient::HttpClient(string const & url) : m_urlRequested(url) +{ + m_headers.emplace("Accept-Encoding", "gzip"); +} + HttpClient & HttpClient::SetUrlRequested(string const & url) { m_urlRequested = url; diff --git a/platform/http_client.hpp b/platform/http_client.hpp index 9e323c7d57..bf7b12cd95 100644 --- a/platform/http_client.hpp +++ b/platform/http_client.hpp @@ -37,7 +37,7 @@ public: static auto constexpr kNoError = -1; HttpClient() = default; - HttpClient(string const & url) : m_urlRequested(url) {} + explicit HttpClient(string const & url); // Synchronous (blocking) call, should be implemented for each platform // @returns true if connection was made and server returned something (200, 404, etc.).