Index: omaha_request_params.cc |
diff --git a/omaha_request_params.cc b/omaha_request_params.cc |
index 4cc5426a02a90e526071492dd42e5414875d14d8..19bcc6a66ea057ecef5705e57bfa2c530e6f8f14 100644 |
--- a/omaha_request_params.cc |
+++ b/omaha_request_params.cc |
@@ -147,8 +147,20 @@ bool OmahaRequestDeviceParams::IsOfficialBuild() const { |
} |
bool OmahaRequestDeviceParams::IsValidTrack(const std::string& track) const { |
- return IsOfficialBuild() ? |
- (track == "beta-channel" || track == "dev-channel") : true; |
+ static const char* kValidTracks[] = { |
+ "canary-channel", |
+ "beta-channel", |
+ "dev-channel", |
+ }; |
+ if (!IsOfficialBuild()) { |
+ return true; |
+ } |
+ for (size_t t = 0; t < arraysize(kValidTracks); ++t) { |
+ if (track == kValidTracks[t]) { |
+ return true; |
+ } |
+ } |
+ return false; |
} |
void OmahaRequestDeviceParams::SetBuildTypeOfficial(bool is_official) { |