diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 38fd72e0..6d676c6e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,7 +4,7 @@ - + @@ -31,18 +31,18 @@ - - + + - - + + - - + + @@ -51,7 +51,7 @@ - + @@ -60,11 +60,11 @@ - + - - + + @@ -72,19 +72,6 @@ - - - - - - - - - - - - - @@ -134,7 +121,7 @@ - + @@ -155,7 +142,6 @@ - list sendRes handleRequ sendRespon @@ -185,6 +171,7 @@ testing cache errorHan + addStre _isClosed @@ -265,7 +252,6 @@ @@ -315,7 +302,6 @@ - @@ -348,6 +334,7 @@ + @@ -685,7 +672,9 @@ - + + + 1481237183504 @@ -1002,16 +991,20 @@ - - + - - - @@ -1024,6 +1017,9 @@ + + + @@ -1038,7 +1034,7 @@ - @@ -1067,7 +1063,7 @@ - + @@ -1094,7 +1090,6 @@ - @@ -1119,7 +1114,8 @@ - @@ -1358,13 +1354,6 @@ - - - - - - - @@ -1409,7 +1398,7 @@ - + @@ -1456,17 +1445,9 @@ - - - - - - - - - + @@ -1474,32 +1455,48 @@ - + - - - - - + + + + + + + + + + + + + + + + + + + - - + + - + - - - + + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 18525337..c5c253e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.1.0+3 +* Modified `ResponseContext#isOpen` to also return `false` if streaming is being used. + # 1.1.0+2 * Modified `handleAngelHttpException` to only run rescue code if the response is still open. Prevents application crashes. @@ -50,50 +53,4 @@ if the response is still open. Prevents application crashes. # 1.1.0-alpha * Removed `AngelFatalError`, and subsequently `fatalErrorStream`. * Removed all `@deprecated` members. -* Removed `@Hooked`, `beforeProcessed`, and `afterProcessed`. - -# 1.0.10 -* Closed [#162](https://github.com/angel-dart/framework/issues/162), fixing a caching bug -that would cause multiple requests to the same URL to fail. -* Resolved dependency injection of primitives (namely `String`), no longer triggering -errors about `String has no constructor`, etc. - -# 1.0.9 -* Closed [#161](https://github.com/angel-dart/framework/issues/161). `addCreated`/`addUpdatedAt` no longer -crash when `serialize` is `false`. -* Added an explicit on `charcode`, `path`, and others. Resolves -[#160](https://github.com/angel-dart/framework/issues/160). -* `ResponseContext` now implements `StreamSink`, so data can be streamed directly to the -underlying response. -* You can now inject `encoders` into a `ResponseContext`, which takes care of `Accept-Encoding`. -This will ultimately replace `package:angel_compress`. -Resolves [#159](https://github.com/angel-dart/framework/issues/159). - -# 1.0.8 -* Changed `req.query` to use a modifiable Map if the body has not parsed. Resolves -[#157](https://github.com/angel-dart/framework/issues/157). -* Changed all constants to `camelCase`, and deprecated their `CONSTANT_CASE` counterparts. Resolves -[#155](https://github.com/angel-dart/framework/issues/155). -* Resolved [#156](https://github.com/angel-dart/framework/issues/156) by adding a `graphql` provider. -* Added an `analysis-options.yaml` enabling strong mode. Preparing for Dart 2.0. -* Added a dependency on `package:meta`, resolving [#154](https://github.com/angel-dart/framework/issues/154), -and added corresponding annotations to make extending Angel easier. -* Resolved [#158](https://github.com/angel-dart/framework/issues/158) by using proper `StreamController` -patterns, to prevent memory leaks. -* Route handler sequences are now cached in a Map, so repeat requests will be resolved faster. -* A message is no longer printed in production mode. -* Removed the inheritance on `Extensible` in many classes, and removed it from `angel_route`. -Now, only `Angel` and `RequestContext` have `@proxy` annotations. -* Deprecated passing `debug` to Angel. -* `_LockableBytesBuilder` now uses `Uint8List`. -* Removed `reopen` from `ResponseContext`. - -# 1.0.7+2 -Changed `ResponseContext.serialize`. The `contentType` is now set *before* serialization. - -# 1.0.7+1 -Moved the `Model` class into `package:angel_model`. No functionality was added or removed. - -# 1.0.7 -Added an `accepts` method to `RequestContext`. It's now a lot easier to tell which content types the -user accepts via the `Accept` header. \ No newline at end of file +* Removed `@Hooked`, `beforeProcessed`, and `afterProcessed`. \ No newline at end of file diff --git a/lib/src/http/response_context.dart b/lib/src/http/response_context.dart index 60c04251..bde72914 100644 --- a/lib/src/http/response_context.dart +++ b/lib/src/http/response_context.dart @@ -84,7 +84,7 @@ class ResponseContext implements StreamSink>, StringSink { } /// Can we still write to this response? - bool get isOpen => _isOpen; + bool get isOpen => _isOpen && !_isClosed; /// A set of UTF-8 encoded bytes that will be written to the response. BytesBuilder get buffer => _buffer; diff --git a/pubspec.yaml b/pubspec.yaml index 76253c2c..6047fced 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_framework -version: 1.1.0+2 +version: 1.1.0+3 description: A high-powered HTTP server with DI, routing and more. author: Tobe O homepage: https://github.com/angel-dart/angel_framework