OLD | NEW |
---|---|
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library http2.test.client_websites_test; | 5 library http2.test.client_websites_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 var spaces = ' ' * (20 - key.length); | 117 var spaces = ' ' * (20 - key.length); |
118 print('$key $spaces ${headers[key].join(', ')}'); | 118 print('$key $spaces ${headers[key].join(', ')}'); |
119 } | 119 } |
120 print(''); | 120 print(''); |
121 } | 121 } |
122 | 122 |
123 Future<String> readBody(Response response) async { | 123 Future<String> readBody(Response response) async { |
124 var stream = response.stream; | 124 var stream = response.stream; |
125 if (response.headers['content-encoding']?.join('') == 'gzip') { | 125 if (response.headers['content-encoding']?.join('') == 'gzip') { |
126 stream = stream.transform(GZIP.decoder); | 126 stream = stream.transform(GZIP.decoder); |
127 } else if (response.headers['content-encoding']?.join('') == 'deflate') { | |
Søren Gjesse
2016/01/11 14:26:35
Separate change from what is in the description?
kustermann
2016/01/11 15:08:33
There is a test for twitter.com in this file, and
| |
128 stream = stream.transform(ZLIB.decoder); | |
127 } | 129 } |
128 return await stream.transform(UTF8.decoder).join(''); | 130 return await stream.transform(UTF8.decoder).join(''); |
129 } | 131 } |
OLD | NEW |