From 88d1a87fa616c6a0618298140007832a68b36996 Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Tue, 15 Mar 2016 12:23:21 +0300 Subject: [PATCH] [editor] Fix OSM Notes upload and Facebook auth test --- editor/editor_tests/osm_auth_test.cpp | 2 +- editor/osm_auth.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/editor/editor_tests/osm_auth_test.cpp b/editor/editor_tests/osm_auth_test.cpp index 75cf54669b..0c2a965405 100644 --- a/editor/editor_tests/osm_auth_test.cpp +++ b/editor/editor_tests/osm_auth_test.cpp @@ -11,7 +11,7 @@ constexpr char const * kIZTestUser = "Testuser"; constexpr char const * kIZTestPassword = "testtest"; constexpr char const * kIZInvalidPassword = "123"; constexpr char const * kIZForgotPasswordEmail = "test@example.com"; -constexpr char const * kFacebookToken = "CAAYYoGXMFUcBAHZBpDFyFPFQroYRMtzdCzXVFiqKcZAZB44jKjzW8WWoaPWI4xxl9EK8INIuTZAkhpURhwSiyOIKoWsgbqZAKEKIKZC3IdlUokPOEuaUpKQzgLTUcYNLiqgJogjUTL1s7Myqpf8cf5yoxQm32cqKZAdozrdx2df4FMJBSF7h0dXI49M2WjCyjPcEKntC4LfQsVwrZBn8uStvUJBVGMTwNWkZD"; +constexpr char const * kFacebookToken = "CAAYYoGXMFUcBAPQSER2m2jJN0EbUHiWWvJS6nsuvKJiCWOmoyAqxYqOQIrZCZCiGkdsQt8aoETBPtylxGPBJe5B6GOKsD7X10b9JUbvxCOPfm4iplQd84ctDwD7GOqLAdq2lb27Dz91Q7nm68HxKKtfU4D2GsS3ZC9UbqCcPXmo3uZAZCNaENiZBFy4jvMczr497mPX5eLDqDxNeBUMhYTtIF9vtqflYEZD"; //constexpr char const * kGoogleToken = "eyJhbGciOiJSUzI1NiIsImtpZCI6IjVhZDc2OGE1ZDhjMTJlYmE3OGJiY2M5Yjg1ZGNlMzJhYzFjZGM3MzYifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhdWQiOiI0MTgwNTMwODI0ODktaTk3MGYwbHJvYjhsNGo1aTE2a2RlOGMydnBzODN0Y2wuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMTQxMTI2Njc5NzEwNTQ0MTk2OTMiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiYXpwIjoiNDE4MDUzMDgyNDg5LTN2a2RzZ2E3cm9pNjI4ZGh2YTZydnN0MmQ4MGY5NWZuLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiZW1haWwiOiJ6dmVyaWtAdGV4dHVhbC5ydSIsImlhdCI6MTQ1MjI2ODI0NCwiZXhwIjoxNDUyMjcxODQ0LCJuYW1lIjoiSWx5YSBadmVyZXYiLCJnaXZlbl9uYW1lIjoiSWx5YSIsImZhbWlseV9uYW1lIjoiWnZlcmV2IiwibG9jYWxlIjoicnUifQ.E55Fwdt--Jln6p-eKZS18U3KNf0233hfJtLZywOxGs9HMiZNG6xZrYwPM8OFGMhweplITtCokZR54wYDD113HH5Bmt5DbdZXgGZ8mZmqS3U_toNeHWI92Zfhew08OUDF_pR1ykV76KqjW4QGQnmeEYYs4O4I2Xw3nyUTAeTxleBHTgBNW-XZHTQc0l_gr3cWULCTuGOKGTSAO6ccVx34r8n1wfbHmWYGEtdNpJxK_AVCl64pCoXL-uEV7Cp3nSKFSW4Ei6b-DW6hygVuhMNWDUZGvxLm8CbQTOHTRRCpM5vuhcPEAQHlxZrmEpU7lLXZCDBEvM9JdDvDicg_WQNf3w"; } // namespace diff --git a/editor/osm_auth.cpp b/editor/osm_auth.cpp index 433c9659f8..ab7739e1a4 100644 --- a/editor/osm_auth.cpp +++ b/editor/osm_auth.cpp @@ -375,8 +375,11 @@ OsmOAuth::Response OsmOAuth::Request(string const & method, string const & httpM else MYTHROW(UnsupportedApiRequestMethod, ("Unsupported OSM API request method", httpMethod)); - string const url = m_apiUrl + kApiVersion + method; + string url = m_apiUrl + kApiVersion + method; string const query = oauth.getURLQueryString(reqType, url); + auto const qPos = url.find('?'); + if (qPos != string::npos) + url = url.substr(0, qPos); HTTPClientPlatformWrapper request(url + "?" + query); if (httpMethod != "GET")