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

Unified Diff: chrome/renderer/resources/extensions/gcm_custom_bindings.js

Issue 141433030: [GCM] Updating the list of restricted keys for GCM API messages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing code reviews from jianli@ and kalman@, fixing a typo in error messages" Created 6 years, 10 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
Index: chrome/renderer/resources/extensions/gcm_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/gcm_custom_bindings.js b/chrome/renderer/resources/extensions/gcm_custom_bindings.js
index 8fcd698a87c9ce89a27f50650f04362d09ece293..fa3e5e4bcba5d41ef80c54a01e1dfccdf795bb86 100644
--- a/chrome/renderer/resources/extensions/gcm_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/gcm_custom_bindings.js
@@ -19,9 +19,11 @@ binding.registerCustomHook(function(bindingsAPI) {
if (property.length == 0)
throw new Error("One of data keys is empty.");
+ var lowerCasedProperty = property.toLowerCase();
// Issue an error for forbidden prefixes of property names.
- if (property.indexOf("goog.") == 0 ||
- property.indexOf("google") == 0) {
+ if (lowerCasedProperty.indexOf("goog.") == 0 ||
+ lowerCasedProperty.indexOf("google") == 0 ||
+ property.indexOf("collapse_key") == 0) {
throw new Error("Invalid data key: " + property);
}
« no previous file with comments | « chrome/common/extensions/api/gcm.json ('k') | chrome/test/data/extensions/api_test/gcm/events/on_send_error.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698