Skip to content

Commit d50ac26

Browse files
authored
Make package strong, also add analysis options file (flutter#4)
* Make package strong, also add analysis options file * Update analysis_options.yaml * Update web_socket_handler.dart * Update pubspec.yaml * Update web_socket_handler.dart
1 parent c87aa8a commit d50ac26

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

analysis_options.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
analyzer:
2+
strong-mode: true

lib/src/web_socket_handler.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import 'dart:convert';
66

77
import 'package:shelf/shelf.dart';
8-
import 'package:stream_channel/stream_channel.dart';
98
import 'package:web_socket_channel/web_socket_channel.dart';
109

1110
/// A class that exposes a handler for upgrading WebSocket requests.
@@ -65,9 +64,7 @@ class WebSocketHandler {
6564
}
6665

6766
var protocol = _chooseProtocol(request);
68-
request.hijack((untypedChannel) {
69-
var channel = (untypedChannel as StreamChannel).cast<List<int>>();
70-
67+
request.hijack((channel) {
7168
var sink = UTF8.encoder.startChunkedConversion(channel.sink);
7269
sink.add(
7370
"HTTP/1.1 101 Switching Protocols\r\n"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ homepage: http://github.com/dart-lang/shelf_web_socket
55
description: >
66
A WebSocket handler for Shelf.
77
dependencies:
8-
shelf: ">=0.6.5 <0.8.0"
8+
shelf: ">=0.7.0 <0.8.0"
99
stream_channel: "^1.4.0"
1010
web_socket_channel: "^1.0.0"
1111
dev_dependencies:

0 commit comments

Comments
 (0)