Merge pull request #15 from debuggerx01/fix_res_json

Fixed res.json() causing 'Bad state: Cannot modify a closed...'
This commit is contained in:
Thomas Hii 2021-12-01 15:03:00 +08:00 committed by GitHub
commit 5e3abdad74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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