The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Plack::Middleware::Method_Allow - perl Plack Middleware to filter HTTP Methods

SYNOPSIS

  builder {
    enable "Plack::Middleware::Method_Allow", allow=>['GET', 'POST'];
    $app;
  };

DESCRIPTION

Explicitly allow HTTP methods and return 405 METHOD NOT ALLOWED for all others

PROPERTIES

allow

Method that sets the allowed HTTP methods. Must be an array reference of strings.

METHODS

prepare_app

Method is called once at load to read the allow list.

call

Method is called for each request which return 405 Method Not Allowed for any HTTP method that is not in list.

SEE ALSO

Plack::Middleware

AUTHOR

Michael R. Davis

COPYRIGHT AND LICENSE

MIT License

Copyright (c) 2022 Michael R. Davis