OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:convert' show JSON, UTF8; | 5 import 'dart:convert' show JSON, UTF8; |
6 | 6 |
7 import 'dart:isolate' show RawReceivePort; | 7 import 'dart:isolate' show RawReceivePort; |
8 | 8 |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
11 import 'package:front_end/src/fasta/errors.dart' show defaultServerAddress; | 11 import 'package:front_end/src/fasta/deprecated_problems.dart' |
| 12 show defaultServerAddress; |
12 | 13 |
13 badRequest(HttpRequest request, int status, String message) { | 14 badRequest(HttpRequest request, int status, String message) { |
14 request.response.statusCode = status; | 15 request.response.statusCode = status; |
15 request.response.write(''' | 16 request.response.write(''' |
16 <!DOCTYPE html> | 17 <!DOCTYPE html> |
17 <html lang="en"> | 18 <html lang="en"> |
18 <head> | 19 <head> |
19 <meta charset="utf-8"> | 20 <meta charset="utf-8"> |
20 <title>$message</title> | 21 <title>$message</title> |
21 </head> | 22 </head> |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 continue; | 102 continue; |
102 } | 103 } |
103 if (request.uri.path != "/") { | 104 if (request.uri.path != "/") { |
104 badRequest(request, HttpStatus.NOT_FOUND, "Not found."); | 105 badRequest(request, HttpStatus.NOT_FOUND, "Not found."); |
105 continue; | 106 continue; |
106 } | 107 } |
107 collectLog(new DateTime.now(), request); | 108 collectLog(new DateTime.now(), request); |
108 } | 109 } |
109 keepAlive.close(); | 110 keepAlive.close(); |
110 } | 111 } |
OLD | NEW |