Chromium Code Reviews| Index: mojo/public/js/bindings/router.js |
| diff --git a/mojo/public/js/bindings/router.js b/mojo/public/js/bindings/router.js |
| index 2718e8b0b7805bec9a81350cadd95a6b8fb13d3f..4d7b829559336fa6113a325980ae6ff322787a56 100644 |
| --- a/mojo/public/js/bindings/router.js |
| +++ b/mojo/public/js/bindings/router.js |
| @@ -3,9 +3,11 @@ |
| // found in the LICENSE file. |
| define("mojo/public/js/bindings/router", [ |
| + "console", |
|
abarth-chromium
2014/07/22 03:51:00
Production code shouldn't use |console|
hansmuller
2014/07/22 15:49:06
OK, I'll remove that.
|
| "mojo/public/js/bindings/codec", |
| "mojo/public/js/bindings/connector", |
| -], function(codec, connector) { |
| + "mojo/public/js/bindings/validator", |
| +], function(console, codec, connector, validator) { |
| function Router(handle) { |
| this.connector_ = new connector.Connector(handle); |
| @@ -60,7 +62,11 @@ define("mojo/public/js/bindings/router", [ |
| }; |
| Router.prototype.handleIncomingMessage_ = function(message) { |
| - var flags = message.getFlags(); |
| + var err = validator.validateMessageHeader(message); |
| + if (err != validator.ValidationError.NONE) |
| + this.close(); |
| + |
| + var flags = message.getHeaderFlags(); |
| if (flags & codec.kMessageExpectsResponse) { |
| if (this.incomingReceiver_) { |
| this.incomingReceiver_.acceptWithResponder(message, this); |