shelf_helmet 2.3.0 copy "shelf_helmet: ^2.3.0" to clipboard
shelf_helmet: ^2.3.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 middleware(Handler handler) {
  return handler.use(
    fromShelfMiddleware(helmet()),
  );
}

As pharaoh middleware #

import 'package:shelf_helmet/shelf_helmet.dart';

app.use(useShelfMiddleware(helmet()));

You can find more specific examples in the readme.

15
likes
160
pub points
76%
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

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

shelf

More

Packages that depend on shelf_helmet