shelf_enforces_ssl 1.0.0 copy "shelf_enforces_ssl: ^1.0.0" to clipboard
shelf_enforces_ssl: ^1.0.0 copied to clipboard

Enforces that users can only make API requests over HTTPS (SSL).

Shelf Enforces SSL #

Ensures that only API Requests with a HTTPS connection are accepted. Inspired by https://github.com/hengkiardo/express-enforces-ssl

Installing #

dart pub add shelf_enforces_ssl

Usage #

As shelf middleware #

import 'package:shelf_enforces_ssl/shelf_enforces_ssl.dart';

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

As dart_frog middleware #

import 'package:shelf_enforces_ssl/shelf_enforces_ssl.dart';

Handler enforceSSL(Handler handler) {
    return handler.use(fromShelfMiddleware(enforceSSL()));
}
9
likes
0
pub points
55%
popularity

Publisher

verified publisherjxstxn.dev

Enforces that users can only make API requests over HTTPS (SSL).

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

shelf

More

Packages that depend on shelf_enforces_ssl