From b734cb0a1df879c7c1b3b74832c3f9e7660e8d91 Mon Sep 17 00:00:00 2001 From: Devin Riegle Date: Sat, 22 Aug 2020 23:39:28 -0400 Subject: [PATCH] Bump version to 0.5.0 --- CHANGELOG.md | 4 ++++ lib/src/middleware/cors.dart | 9 ++++++++- pubspec.yaml | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9e0c9b..f76be44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,3 +43,7 @@ - Add all files as part of `dart_express` library - Change visibility of certain classes - Defer loading of View template libraries + +## 0.5.0 + +- Add CORS middleware diff --git a/lib/src/middleware/cors.dart b/lib/src/middleware/cors.dart index 34d5a80..e43a948 100644 --- a/lib/src/middleware/cors.dart +++ b/lib/src/middleware/cors.dart @@ -12,7 +12,14 @@ class CorsOptions { const CorsOptions({ this.origin = '*', - this.methods = _HTTPMethods.ALL, + this.methods = const [ + _HTTPMethods.GET, + _HTTPMethods.HEAD, + _HTTPMethods.PUT, + _HTTPMethods.PATCH, + _HTTPMethods.POST, + _HTTPMethods.DELETE, + ], this.preflightContinue = false, this.optionsSuccessStatus = 204, this.credentials = false, diff --git a/pubspec.yaml b/pubspec.yaml index 4b75ec9..55d0a13 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: dart_express description: An unopinionated express-like HTTP framework built in Dart, includes the ability to render Mustache, Jael and HTML files, and simple routing. -version: 0.4.0 +version: 0.5.0 homepage: https://github.com/deriegle/dart-express environment: