Skip to content

Commit

Permalink
Merge pull request #7 from devoncarew/dart2
Browse files Browse the repository at this point in the history
dart 2 updates
  • Loading branch information
devoncarew authored Jul 19, 2018
2 parents a8884ac + 789d208 commit 6b4c23b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.2.2

- updates for Dart 2

## 0.2.1

- update the styles for the directory listings to use
Expand Down
3 changes: 0 additions & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
analyzer:
strong-mode: true

linter:
rules:
- always_declare_return_types
Expand Down
2 changes: 1 addition & 1 deletion lib/src/directories.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,5 @@ Response listDirectory(String appName, String fileSystemPath, String dirPath) {
});

return new Response.ok(controller.stream,
encoding: encoding, headers: {HttpHeaders.CONTENT_TYPE: 'text/html'});
encoding: encoding, headers: {HttpHeaders.contentTypeHeader: 'text/html'});
}
6 changes: 3 additions & 3 deletions lib/src/packages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ Future<Response> _handleFile(Request request, File file) async {
}

var headers = {
HttpHeaders.CONTENT_LENGTH: stat.size.toString(),
HttpHeaders.LAST_MODIFIED: formatHttpDate(stat.changed)
HttpHeaders.contentLengthHeader: stat.size.toString(),
HttpHeaders.lastModifiedHeader: formatHttpDate(stat.changed)
};

String contentType = _mimeTypeResolver.lookup(file.path);
if (contentType != null) {
headers[HttpHeaders.CONTENT_TYPE] = contentType;
headers[HttpHeaders.contentTypeHeader] = contentType;
}

return new Response.ok(file.openRead(), headers: headers);
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: mserve
description: A small (micro) web server.
version: 0.2.1
version: 0.2.2
author: Devon Carew <[email protected]>
homepage: https://github.com/devoncarew/mserve.dart

environment:
sdk: '>=2.0.0-dev.30 <2.0.0'
sdk: '>=2.0.0-dev.30 <3.0.0'

dependencies:
args: ^1.0.0
Expand All @@ -20,7 +20,7 @@ dependencies:
shelf_static: ^0.2.0

dev_dependencies:
test: ^0.12.0
test: ^1.0.0

executables:
mserve: null

0 comments on commit 6b4c23b

Please sign in to comment.