2.0.0-alpha.13

This commit is contained in:
Tobe O 2018-11-13 16:17:31 -05:00
parent 8f8bc6cf20
commit dde983245d
5 changed files with 22 additions and 5 deletions

View file

@ -1,3 +1,7 @@
# 2.0.0-alpha.13
- Fixed a logic error in `HttpResponseContext` that prevented status codes from being sent.
# 2.0.0-alpha.12 # 2.0.0-alpha.12
- Remove `ResponseContext.sendFile`. - Remove `ResponseContext.sendFile`.

View file

@ -1,8 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'dart:isolate'; import 'dart:isolate';
import 'package:angel_container/mirrors.dart';
import 'package:angel_framework/angel_framework.dart'; import 'package:angel_framework/angel_framework.dart';
import 'package:angel_framework/http.dart'; import 'package:angel_framework/http.dart';
@ -33,11 +31,11 @@ main() async {
} }
serverMain(_) async { serverMain(_) async {
var app = new Angel(reflector: MirrorsReflector()); var app = new Angel();
var http = new AngelHttp.custom(app, startShared); // Run a cluster var http = new AngelHttp.custom(app, startShared); // Run a cluster
app.get('/', (req, res) { app.get('/', (req, res) {
res.serialize({ return res.serialize({
"foo": "bar", "foo": "bar",
"one": [2, "three"], "one": [2, "three"],
"bar": {"baz": "quux"} "bar": {"baz": "quux"}

14
example/status.dart Normal file
View file

@ -0,0 +1,14 @@
import 'package:angel_framework/angel_framework.dart';
import 'package:angel_framework/http.dart';
main() async {
var app = new Angel();
var http = new AngelHttp(app);
app.fallback((req, res) {
res.statusCode = 304;
});
await http.startServer('127.0.0.1', 3000);
print('Listening at ${http.uri}');
}

View file

@ -186,6 +186,7 @@ class HttpResponseContext extends ResponseContext<HttpResponse> {
if (!_isClosed) { if (!_isClosed) {
if (!isBuffered) { if (!isBuffered) {
try { try {
_openStream();
rawResponse.close(); rawResponse.close();
} catch (_) { } catch (_) {
// This only seems to occur on `MockHttpRequest`, but // This only seems to occur on `MockHttpRequest`, but

View file

@ -1,5 +1,5 @@
name: angel_framework name: angel_framework
version: 2.0.0-alpha.12 version: 2.0.0-alpha.13
description: A high-powered HTTP server with dependency injection, routing and much more. description: A high-powered HTTP server with dependency injection, routing and much more.
author: Tobe O <thosakwe@gmail.com> author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/angel_framework homepage: https://github.com/angel-dart/angel_framework