Skip to content
This repository was archived by the owner on May 10, 2022. It is now read-only.

Commit abae695

Browse files
authored
Pass a Uri to package:http APIs (#25)
Prepare for dart-lang/http#375
1 parent 8050a55 commit abae695

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/web_socket_test.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ void main() {
6868
});
6969

7070
group('with a set of allowed origins', () {
71-
var server;
72-
var url;
71+
HttpServer server;
72+
Uri url;
7373
setUp(() async {
7474
server = await shelf_io.serve(
7575
webSocketHandler((webSocket) {
7676
webSocket.sink.close();
7777
}, allowedOrigins: ['pub.dartlang.org', 'GoOgLe.CoM']),
7878
'localhost',
7979
0);
80-
url = 'http://localhost:${server.port}/';
80+
url = Uri.http('localhost:${server.port}', '');
8181
});
8282

8383
tearDown(() => server.close());
@@ -117,21 +117,21 @@ void main() {
117117
webSocket.sink.close();
118118
}), 'localhost', 0);
119119

120-
var url = 'http://localhost:${server.port}/';
120+
var url = Uri.http('localhost:${server.port}', '');
121121
var headers = _handshakeHeaders;
122122
headers['Connection'] = 'Other-Token, Upgrade';
123123
expect(http.get(url, headers: headers).whenComplete(server.close),
124124
hasStatus(101));
125125
});
126126

127127
group('HTTP errors', () {
128-
var server;
129-
var url;
128+
HttpServer server;
129+
Uri url;
130130
setUp(() async {
131131
server = await shelf_io.serve(webSocketHandler((_) {
132132
fail('should not create a WebSocket');
133133
}), 'localhost', 0);
134-
url = 'http://localhost:${server.port}/';
134+
url = Uri.http('localhost:${server.port}', '');
135135
});
136136

137137
tearDown(() => server.close());

0 commit comments

Comments
 (0)