class

Ktistec::CSRF

Inherits Kemal::Handler < Kemal::HandlerInterface < HTTP::Handler < Reference < Object

CSRF preventing middleware.

Constructors

new(header : String = "X-CSRF-Token", allowed_routes : Array(String) = [] of String, allowed_methods : Array(String) = ["GET", "HEAD", "OPTIONS", "TRACE"] of ::String, enforced_content_types : Array(String) = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"] of ::String, parameter_name : String = "authenticity_token", error : String | HTTP::Server::Context -> String = "Forbidden (CSRF)")
Source

Instance methods

call(context)
Source
setup
Source