fix: res.json() will cause 'Bad state: Cannot modify a closed response.' error.

This commit is contained in:
debuggerx01 2021-11-30 18:32:48 +08:00
parent da207f2ddf
commit ad0e6ecf06

View file

@ -169,9 +169,8 @@ abstract class ResponseContext<RawResponse>
}
/// Serializes JSON to the response.
void json(value) => this
..contentType = MediaType('application', 'json')
..serialize(value);
Future<bool> json(value) =>
this.serialize(value, contentType: MediaType('application', 'json'));
/// Returns a JSONP response.
///