Correctly pass encoding in all Response constructors
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a0ed6af..31b8cc8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,9 @@
## 0.7.4
-* Allow passing `shared` parameter to underlying `HttpServer.bind` calls via `shelf_io.serve`
+* Allow passing `shared` parameter to underlying `HttpServer.bind` calls via
+ `shelf_io.serve`.
+* Correctly pass `encoding` in `Response` constructors `forbidden`, `notFound`,
+ and `internalServerError`.
## 0.7.3+3
diff --git a/analysis_options.yaml b/analysis_options.yaml
index f04af43..6f476fe 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -7,6 +7,7 @@
- avoid_empty_else
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
+ - avoid_unused_constructor_parameters
- await_only_futures
- camel_case_types
- cancel_subscriptions
diff --git a/lib/src/response.dart b/lib/src/response.dart
index b6cb0f0..b7275b0 100644
--- a/lib/src/response.dart
+++ b/lib/src/response.dart
@@ -199,7 +199,8 @@
: this(403,
headers: body == null ? _adjustErrorHeaders(headers) : headers,
body: body == null ? 'Forbidden' : body,
- context: context);
+ context: context,
+ encoding: encoding);
/// Constructs a 404 Not Found response.
///
@@ -227,7 +228,8 @@
: this(404,
headers: body == null ? _adjustErrorHeaders(headers) : headers,
body: body == null ? 'Not Found' : body,
- context: context);
+ context: context,
+ encoding: encoding);
/// Constructs a 500 Internal Server Error response.
///
@@ -256,7 +258,8 @@
: this(500,
headers: body == null ? _adjustErrorHeaders(headers) : headers,
body: body == null ? 'Internal Server Error' : body,
- context: context);
+ context: context,
+ encoding: encoding);
/// Constructs an HTTP response with the given [statusCode].
///