| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 utils; | 5 library utils; |
| 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 import "package:path/path.dart"; | |
| 11 | 10 |
| 12 Future<int> getStatusCode(int port, | 11 Future<int> getStatusCode(int port, |
| 13 String path, | 12 String path, |
| 14 {String host, | 13 {String host, |
| 15 bool secure: false, | 14 bool secure: false, |
| 16 DateTime ifModifiedSince, | 15 DateTime ifModifiedSince, |
| 17 bool rawPath: false}) { | 16 bool rawPath: false}) { |
| 18 var uri; | 17 var uri; |
| 19 if (rawPath) { | 18 if (rawPath) { |
| 20 uri = new Uri(scheme: secure ? 'https' : 'http', | 19 uri = new Uri(scheme: secure ? 'https' : 'http', |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 54 |
| 56 | 55 |
| 57 const CERTIFICATE = "localhost_cert"; | 56 const CERTIFICATE = "localhost_cert"; |
| 58 | 57 |
| 59 | 58 |
| 60 setupSecure() { | 59 setupSecure() { |
| 61 String certificateDatabase = Platform.script.resolve('pkcert').toFilePath(); | 60 String certificateDatabase = Platform.script.resolve('pkcert').toFilePath(); |
| 62 SecureSocket.initialize(database: certificateDatabase, | 61 SecureSocket.initialize(database: certificateDatabase, |
| 63 password: 'dartdart'); | 62 password: 'dartdart'); |
| 64 } | 63 } |
| OLD | NEW |