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

Unified Diff: lib/src/web_socket_handler.dart

Issue 1975493002: Fix all strong-mode warnings. (Closed) Base URL: git@github.com:dart-lang/shelf_web_socket@master
Patch Set: Created 4 years, 7 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 | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/web_socket_handler.dart
diff --git a/lib/src/web_socket_handler.dart b/lib/src/web_socket_handler.dart
index b8f94a239a59134c760513c10646f92c129817c0..73dcfef30c63106107a553763a25db1b889c6652 100644
--- a/lib/src/web_socket_handler.dart
+++ b/lib/src/web_socket_handler.dart
@@ -5,6 +5,7 @@
import 'dart:convert';
import 'package:shelf/shelf.dart';
+import 'package:stream_channel/stream_channel.dart';
import 'package:web_socket_channel/web_socket_channel.dart';
/// A class that exposes a handler for upgrading WebSocket requests.
@@ -64,7 +65,9 @@ class WebSocketHandler {
}
var protocol = _chooseProtocol(request);
- request.hijack((channel) {
+ request.hijack((untypedChannel) {
+ var channel = (untypedChannel as StreamChannel).cast/*<List<int>>*/();
+
var sink = UTF8.encoder.startChunkedConversion(channel.sink);
sink.add(
"HTTP/1.1 101 Switching Protocols\r\n"
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698