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

Unified Diff: pkg/shelf_web_socket/lib/src/web_socket_handler.dart

Issue 810133002: Fix shelf_web_socket's Connection handling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | « pkg/shelf_web_socket/CHANGELOG.md ('k') | pkg/shelf_web_socket/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/shelf_web_socket/lib/src/web_socket_handler.dart
diff --git a/pkg/shelf_web_socket/lib/src/web_socket_handler.dart b/pkg/shelf_web_socket/lib/src/web_socket_handler.dart
index ac5786a95cadb14f5518c0e35634a33ecb7df75f..7ab8e7eb9764b20c8a77453ba3b9b2c5b8646afd 100644
--- a/pkg/shelf_web_socket/lib/src/web_socket_handler.dart
+++ b/pkg/shelf_web_socket/lib/src/web_socket_handler.dart
@@ -28,7 +28,9 @@ class WebSocketHandler {
var connection = request.headers['Connection'];
if (connection == null) return _notFound();
- if (connection.toLowerCase() != 'upgrade') return _notFound();
+ var tokens = connection.toLowerCase().split(',')
+ .map((token) => token.trim());
+ if (!tokens.contains('upgrade')) return _notFound();
var upgrade = request.headers['Upgrade'];
if (upgrade == null) return _notFound();
« no previous file with comments | « pkg/shelf_web_socket/CHANGELOG.md ('k') | pkg/shelf_web_socket/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698