fix: res.json() will cause 'Bad state: Cannot modify a closed response.' error.
This commit is contained in:
parent
da207f2ddf
commit
ad0e6ecf06
1 changed files with 2 additions and 3 deletions
|
@ -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.
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue