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

Unified Diff: test/http_multipart_test.dart

Issue 2945343002: Change '127.0.0.1' to 'localhost' to support both IPv4 and IPv6 envs. (Closed)
Patch Set: address comments Created 3 years, 6 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 | « test/http_body_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/http_multipart_test.dart
diff --git a/test/http_multipart_test.dart b/test/http_multipart_test.dart
index 96d57026827f1f0df645c4632cedacd1a958a6eb..5c94ed6c95404a2b1e2b3a732c4379400de69ea6 100644
--- a/test/http_multipart_test.dart
+++ b/test/http_multipart_test.dart
@@ -49,8 +49,9 @@ void postDataTest(List<int> message,
String contentType,
String boundary,
List<FormField> expectedFields,
- {defaultEncoding: LATIN1}) {
- HttpServer.bind("127.0.0.1", 0).then((server) {
+ {defaultEncoding: LATIN1}) async {
+ var addr = (await InternetAddress.lookup("localhost"))[0];
+ HttpServer.bind(addr, 0).then((server) {
server.listen((request) {
String boundary = request.headers.contentType.parameters['boundary'];
request
@@ -86,7 +87,7 @@ void postDataTest(List<int> message,
});
});
var client = new HttpClient();
- client.post('127.0.0.1', server.port, '/')
+ client.post('localhost', server.port, '/')
.then((request) {
request.headers.set('content-type',
'multipart/form-data; boundary=$boundary');
« no previous file with comments | « test/http_body_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698