From eddbc658d7acc994b100216935b2f9560f4f55a8 Mon Sep 17 00:00:00 2001 From: Justin Baumann Date: Thu, 1 Feb 2024 18:41:06 +0100 Subject: [PATCH] Add As pharaoh middleware section --- CHANGELOG.md | 4 ++++ README.md | 10 +++++++++- pubspec.yaml | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0525ce..e2a9239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.2.1 + +- Add `As pharaoh middleware` section in README. + ## 2.2.0 - Add `CrossOriginEmbedderPolicy unsafe-none`. diff --git a/README.md b/README.md index 78b593a..e4fd986 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,21 @@ var handler = const Pipeline() ```dart import 'package:shelf_helmet/shelf_helmet.dart'; -Handler helmet(Handler handler) { +Handler middleware(Handler handler) { return handler.use( fromShelfMiddleware(helmet()), ); } ``` +### As pharaoh middleware + +```dart +import 'package:shelf_helmet/shelf_helmet.dart'; + +app.use(useShelfMiddleware(helmet())); +``` + By default, Helmet sets the following headers: ```http diff --git a/pubspec.yaml b/pubspec.yaml index 61eed31..406b76a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: shelf_helmet description: A port of the NodeJS helmet package to Dart. Helmet helps you secure your Dart Shelf/Frog apps by setting various HTTP headers. -version: 2.2.0 +version: 2.2.1 homepage: https://jxstxn.de repository: https://github.com/jxstxn1/shelf_helmet issue_tracker: https://github.com/jxstxn1/shelf_helmet/issues