From 4df78749f1ca2ceb62f68a04afebc9b57cf3b5ce Mon Sep 17 00:00:00 2001 From: Tobe O Date: Sun, 10 Mar 2019 23:04:49 -0400 Subject: [PATCH] Add charset=utf-8 to res.render --- CHANGELOG.md | 3 +++ lib/src/core/response_context.dart | 2 +- pubspec.yaml | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 894af546..0e7bd292 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.0-alpha.23 +* `ResponseContext.render` sets `charset` to `utf8` in `contentType`. + # 2.0.0-alpha.22 * Update pipeline handling mechanism, and inject a `MiddlewarePipelineIterator`. * This allows routes to know where in the resolution process they exist, at runtime. diff --git a/lib/src/core/response_context.dart b/lib/src/core/response_context.dart index 50697dd5..eb4de267 100644 --- a/lib/src/core/response_context.dart +++ b/lib/src/core/response_context.dart @@ -184,7 +184,7 @@ abstract class ResponseContext /// Renders a view to the response stream, and closes the response. Future render(String view, [Map data]) { if (!isOpen) throw closed(); - contentType = new MediaType('text', 'html'); + contentType = new MediaType('text', 'html', {'charset': 'utf-8'}); return Future.sync(() => app.viewGenerator( view, new Map.from(renderParams) diff --git a/pubspec.yaml b/pubspec.yaml index af4db52c..c330d3f8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_framework -version: 2.0.0-alpha.22 +version: 2.0.0-alpha.23 description: A high-powered HTTP server with dependency injection, routing and much more. author: Tobe O homepage: https://github.com/angel-dart/angel_framework @@ -30,4 +30,4 @@ dependencies: dev_dependencies: http: ^0.11.3 io: ^0.3.0 - test: ^1.0.0 \ No newline at end of file + test: ^1.0.0