Skip to content

Commit 6b4c23b

Browse files
authored
Merge pull request #7 from devoncarew/dart2
dart 2 updates
2 parents a8884ac + 789d208 commit 6b4c23b

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.2.2
4+
5+
- updates for Dart 2
6+
37
## 0.2.1
48

59
- update the styles for the directory listings to use

analysis_options.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
analyzer:
2-
strong-mode: true
3-
41
linter:
52
rules:
63
- always_declare_return_types

lib/src/directories.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,5 @@ Response listDirectory(String appName, String fileSystemPath, String dirPath) {
170170
});
171171

172172
return new Response.ok(controller.stream,
173-
encoding: encoding, headers: {HttpHeaders.CONTENT_TYPE: 'text/html'});
173+
encoding: encoding, headers: {HttpHeaders.contentTypeHeader: 'text/html'});
174174
}

lib/src/packages.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ Future<Response> _handleFile(Request request, File file) async {
104104
}
105105

106106
var headers = {
107-
HttpHeaders.CONTENT_LENGTH: stat.size.toString(),
108-
HttpHeaders.LAST_MODIFIED: formatHttpDate(stat.changed)
107+
HttpHeaders.contentLengthHeader: stat.size.toString(),
108+
HttpHeaders.lastModifiedHeader: formatHttpDate(stat.changed)
109109
};
110110

111111
String contentType = _mimeTypeResolver.lookup(file.path);
112112
if (contentType != null) {
113-
headers[HttpHeaders.CONTENT_TYPE] = contentType;
113+
headers[HttpHeaders.contentTypeHeader] = contentType;
114114
}
115115

116116
return new Response.ok(file.openRead(), headers: headers);

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: mserve
22
description: A small (micro) web server.
3-
version: 0.2.1
3+
version: 0.2.2
44
author: Devon Carew <[email protected]>
55
homepage: https://github.com/devoncarew/mserve.dart
66

77
environment:
8-
sdk: '>=2.0.0-dev.30 <2.0.0'
8+
sdk: '>=2.0.0-dev.30 <3.0.0'
99

1010
dependencies:
1111
args: ^1.0.0
@@ -20,7 +20,7 @@ dependencies:
2020
shelf_static: ^0.2.0
2121

2222
dev_dependencies:
23-
test: ^0.12.0
23+
test: ^1.0.0
2424

2525
executables:
2626
mserve: null

0 commit comments

Comments
 (0)