Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: pkg/shelf/lib/shelf_io.dart

Issue 300023003: pkg/shelf - send Date header in shelf_io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: final tweaks Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/shelf/README.md ('k') | pkg/shelf/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/shelf/lib/shelf_io.dart
diff --git a/pkg/shelf/lib/shelf_io.dart b/pkg/shelf/lib/shelf_io.dart
index d8d4d9ca3175e9b0cfea38c36302eeee00bfeb22..6582e5a0688658b38c628629981dfb47bb9ae35d 100644
--- a/pkg/shelf/lib/shelf_io.dart
+++ b/pkg/shelf/lib/shelf_io.dart
@@ -121,6 +121,11 @@ Future _writeResponse(Response response, HttpResponse httpResponse) {
var value = httpResponse.headers.value(HttpHeaders.SERVER);
httpResponse.headers.set(HttpHeaders.SERVER, '$value with Shelf');
}
+
+ if (!response.headers.containsKey(HttpHeaders.DATE)) {
+ httpResponse.headers.date = new DateTime.now().toUtc();
+ }
+
return httpResponse.addStream(response.read())
.then((_) => httpResponse.close());
}
« no previous file with comments | « pkg/shelf/README.md ('k') | pkg/shelf/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698