Merge lp:~unity-team/unity-scopes-api/partner-id-update into lp:unity-scopes-api

Proposed by Paweł Stołowski
Status: Merged
Approved by: Marcus Tomlinson
Approved revision: 271
Merged at revision: 272
Proposed branch: lp:~unity-team/unity-scopes-api/partner-id-update
Merge into: lp:unity-scopes-api
Diff against target: 34 lines (+3/-3)
2 files modified
src/scopes/internal/smartscopes/SmartScopesClient.cpp (+1/-1)
test/gtest/scopes/internal/smartscopes/SmartScopesClient/SmartScopesClient_test.cpp (+2/-2)
To merge this branch: bzr merge lp:~unity-team/unity-scopes-api/partner-id-update
Reviewer Review Type Date Requested Status
Marcus Tomlinson (community) Approve
Review via email: mp+244406@code.launchpad.net

Commit message

Use 'partner' in UserAgent instead of partner_id for consistency with shell plugin

Description of the change

Use 'partner' in UserAgent instead of partner_id for consistency with shell plugin

To post a comment you must log in.
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/scopes/internal/smartscopes/SmartScopesClient.cpp'
2--- src/scopes/internal/smartscopes/SmartScopesClient.cpp 2014-12-09 11:34:26 +0000
3+++ src/scopes/internal/smartscopes/SmartScopesClient.cpp 2014-12-11 10:44:43 +0000
4@@ -185,7 +185,7 @@
5 auto partner_id = util::read_text_file(partner_file_);
6 if (!partner_id.empty())
7 {
8- std::string const user_agent_hdr = "partner_id=" + http_client_->to_percent_encoding(partner_id);
9+ std::string const user_agent_hdr = "partner=" + http_client_->to_percent_encoding(partner_id);
10 headers.push_back(std::make_pair("User-Agent", user_agent_hdr));
11 BOOST_LOG_SEV(logger_, Logger::Info) << "User agent: " << user_agent_hdr;
12 }
13
14=== modified file 'test/gtest/scopes/internal/smartscopes/SmartScopesClient/SmartScopesClient_test.cpp'
15--- test/gtest/scopes/internal/smartscopes/SmartScopesClient/SmartScopesClient_test.cpp 2014-12-09 11:34:26 +0000
16+++ test/gtest/scopes/internal/smartscopes/SmartScopesClient/SmartScopesClient_test.cpp 2014-12-11 10:44:43 +0000
17@@ -145,7 +145,7 @@
18 EXPECT_EQ("news", scopes[2].keywords[2]);
19 EXPECT_EQ("games", scopes[2].keywords[3]);
20
21- EXPECT_TRUE(grep_string("/remote-scopes : partner_id=Partner%20String"));
22+ EXPECT_TRUE(grep_string("/remote-scopes : partner=Partner%20String"));
23 }
24
25 TEST_F(SmartScopesClientTest, remote_scopes_no_partner)
26@@ -153,7 +153,7 @@
27 std::vector<RemoteScope> scopes;
28 auto ssc_no_partner_ = std::make_shared<SmartScopesClient>(http_client_, json_node_, test_logger::get(), sss_url_, "/this/file/doesnt/exist");
29 EXPECT_TRUE(ssc_no_partner_->get_remote_scopes(scopes, "", false));
30- EXPECT_FALSE(grep_string("/remote-scopes : partner_id"));
31+ EXPECT_FALSE(grep_string("/remote-scopes : partner"));
32 }
33
34 TEST_F(SmartScopesClientTest, search)

Subscribers

People subscribed via source and target branches

to all changes: