v0.1.1+1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 075e2a8..125da77 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,9 @@
+## 0.1.1+1
+
+* Removed work around for [issue](https://codereview.chromium.org/278783002/).
+
## 0.1.1
* Correctly handle requests when not hosted at the root of a site.
* Send `last-modified` header.
* Work around [known issue](https://codereview.chromium.org/278783002/) with HTTP date formatting.
-
diff --git a/lib/shelf_static.dart b/lib/shelf_static.dart
index 0049f1d..6ef0af8 100644
--- a/lib/shelf_static.dart
+++ b/lib/shelf_static.dart
@@ -2,6 +2,7 @@
import 'dart:io';
+import 'package:http_parser/http_parser.dart';
import 'package:path/path.dart' as p;
import 'package:shelf/shelf.dart';
@@ -46,36 +47,9 @@
var headers = <String, String>{
HttpHeaders.CONTENT_LENGTH: fileStat.size.toString(),
- HttpHeaders.LAST_MODIFIED: _formatHttpDate(fileStat.changed)
+ HttpHeaders.LAST_MODIFIED: formatHttpDate(fileStat.changed)
};
return new Response.ok(file.openRead(), headers: headers);
};
}
-
-const _WEEKDAYS = const ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
-const _MONTHS = const ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
- "Sep", "Oct", "Nov", "Dec"];
-
-// TODO(kevmoo) remove once http_parser fix
-// https://codereview.chromium.org/278783002/ is landed
-String _formatHttpDate(DateTime date) {
- date = date.toUtc();
- var buffer = new StringBuffer()
- ..write(_WEEKDAYS[date.weekday - 1])
- ..write(", ")
- ..write(date.day <= 9 ? "0" : "")
- ..write(date.day.toString())
- ..write(" ")
- ..write(_MONTHS[date.month - 1])
- ..write(" ")
- ..write(date.year.toString())
- ..write(date.hour <= 9 ? " 0" : " ")
- ..write(date.hour.toString())
- ..write(date.minute <= 9 ? ":0" : ":")
- ..write(date.minute.toString())
- ..write(date.second <= 9 ? ":0" : ":")
- ..write(date.second.toString())
- ..write(" GMT");
- return buffer.toString();
-}
diff --git a/pubspec.yaml b/pubspec.yaml
index 18ba5ed..29a2522 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,12 +1,12 @@
name: shelf_static
-version: 0.1.1
+version: 0.1.1+1
author: Kevin Moore <github@j832.com>
description: Static file server support for Shelf
homepage: https://github.com/kevmoo/shelf_static.dart
environment:
sdk: '>=1.0.0 <2.0.0'
dependencies:
- http_parser: '>=0.0.2 <0.1.0'
+ http_parser: '>=0.0.2+2 <0.1.0'
shelf: '>=0.5.0 <0.6.0'
dev_dependencies:
hop: '>=0.30.4 <0.31.0'