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: