2.0.0-alpha.13
This commit is contained in:
parent
8f8bc6cf20
commit
dde983245d
5 changed files with 22 additions and 5 deletions
|
@ -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
|
||||
|
||||
- Remove `ResponseContext.sendFile`.
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'dart:isolate';
|
||||
|
||||
import 'package:angel_container/mirrors.dart';
|
||||
import 'package:angel_framework/angel_framework.dart';
|
||||
import 'package:angel_framework/http.dart';
|
||||
|
||||
|
@ -33,11 +31,11 @@ main() async {
|
|||
}
|
||||
|
||||
serverMain(_) async {
|
||||
var app = new Angel(reflector: MirrorsReflector());
|
||||
var app = new Angel();
|
||||
var http = new AngelHttp.custom(app, startShared); // Run a cluster
|
||||
|
||||
app.get('/', (req, res) {
|
||||
res.serialize({
|
||||
return res.serialize({
|
||||
"foo": "bar",
|
||||
"one": [2, "three"],
|
||||
"bar": {"baz": "quux"}
|
||||
|
|
14
example/status.dart
Normal file
14
example/status.dart
Normal 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}');
|
||||
}
|
|
@ -186,6 +186,7 @@ class HttpResponseContext extends ResponseContext<HttpResponse> {
|
|||
if (!_isClosed) {
|
||||
if (!isBuffered) {
|
||||
try {
|
||||
_openStream();
|
||||
rawResponse.close();
|
||||
} catch (_) {
|
||||
// This only seems to occur on `MockHttpRequest`, but
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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.
|
||||
author: Tobe O <thosakwe@gmail.com>
|
||||
homepage: https://github.com/angel-dart/angel_framework
|
||||
|
|
Loading…
Reference in a new issue