Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(871)

Unified Diff: components/update_client/update_response.cc

Issue 2856573003: Fix the broken XML parser due to version mismatch. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/update_client/update_response.h ('k') | components/update_client/update_response_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/update_response.cc
diff --git a/components/update_client/update_response.cc b/components/update_client/update_response.cc
index c2349c11186705eb2112e3071292839a0a7adf6c..8fbc1ec094d781d184ea1f66e5c3b1125431437d 100644
--- a/components/update_client/update_response.cc
+++ b/components/update_client/update_response.cc
@@ -20,7 +20,6 @@
namespace update_client {
-static const char* kExpectedResponseProtocol = "3.0";
const char UpdateResponse::Result::kCohort[] = "cohort";
const char UpdateResponse::Result::kCohortHint[] = "cohorthint";
const char UpdateResponse::Result::kCohortName[] = "cohortname";
@@ -367,11 +366,12 @@ bool UpdateResponse::Parse(const std::string& response_xml) {
}
// Check for the response "protocol" attribute.
- if (GetAttribute(root, "protocol") != kExpectedResponseProtocol) {
+ const auto protocol = GetAttribute(root, "protocol");
+ if (protocol != kProtocolVersion) {
ParseError(
"Missing/incorrect protocol on response tag "
- "(expected '%s')",
- kExpectedResponseProtocol);
+ "(expected '%s', found '%s')",
+ kProtocolVersion, protocol.c_str());
return false;
}
« no previous file with comments | « components/update_client/update_response.h ('k') | components/update_client/update_response_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698