shelf_helmet 2.2.0 copy "shelf_helmet: ^2.2.0" to clipboard
shelf_helmet: ^2.2.0 copied to clipboard

A port of the NodeJS helmet package to Dart. Helmet helps you secure your Dart Shelf/Frog apps by setting various HTTP headers.

example/README.md

Example #

Quick start #

First, run dart pub add shelf_helmet for your app. Then:

As shelf middleware #

import 'package:shelf_helmet/shelf_helmet.dart';

var handler = const Pipeline()
    .addMiddleware(helmet())
    .addMiddleware(logRequests())
    .addHandler(_echoRequest);

As dart_frog middleware #

import 'package:shelf_helmet/shelf_helmet.dart';

Handler helmet(Handler handler) {
  return handler.use(
    fromShelfMiddleware(helmet()),
  );
}

You can find more specific examples in the readme.

12
likes
0
pub points
75%
popularity

Publisher

verified publisherjxstxn.dev

A port of the NodeJS helmet package to Dart. Helmet helps you secure your Dart Shelf/Frog apps by setting various HTTP headers.

Homepage
Repository (GitHub)
View/report issues

Topics

#shelf #security #helmet #dart-frog #middleware

License

unknown (LICENSE)

Dependencies

shelf

More

Packages that depend on shelf_helmet