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

Unified Diff: pkg/http_server/lib/src/virtual_directory.dart

Issue 360453004: Use utf-8 encoding for listing and error page, in http_server VirtualDirectory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update right pubspec... Created 6 years, 6 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 | « no previous file | pkg/http_server/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http_server/lib/src/virtual_directory.dart
diff --git a/pkg/http_server/lib/src/virtual_directory.dart b/pkg/http_server/lib/src/virtual_directory.dart
index 98dd963070f488bf8d32ce5d2ed1b8ecc524703b..f34baeaa5a3f5188a870211e02f494a81df342fc 100644
--- a/pkg/http_server/lib/src/virtual_directory.dart
+++ b/pkg/http_server/lib/src/virtual_directory.dart
@@ -254,6 +254,8 @@ class VirtualDirectory {
return;
}
+ response.headers.contentType =
+ new ContentType('text', 'html', parameters: {'charset': 'utf-8'});
response.headers.set(HttpHeaders.LAST_MODIFIED, stats.modified);
var path = Uri.decodeComponent(request.uri.path);
var encodedPath = new HtmlEscape().convert(path);
@@ -340,6 +342,8 @@ $server
_errorCallback(request);
return;
}
+ response.headers.contentType =
+ new ContentType('text', 'html', parameters: {'charset': 'utf-8'});
// Default error page.
var path = Uri.decodeComponent(request.uri.path);
var encodedPath = new HtmlEscape().convert(path);
« no previous file with comments | « no previous file | pkg/http_server/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698