TrimStringsMiddleware class final
Trims surrounding whitespace from every string input, except the keys
listed in except (Laravel's TrimStrings, which skips passwords).
Like every input transformer it applies to the input as the client sent
it, not to fields a later Request.merge adds, and except names
dotted paths (user.password).
- Implemented types
Constructors
-
TrimStringsMiddleware({Set<
String> except = defaultExcept}) -
Trims every string in the input, except the given keys
(defaultExcept: the password fields, as in Laravel).
const
Properties
Methods
-
handle(
Request request, Next next) → Future< Response> -
Handles
request: return a response, or callnextto continue.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
defaultExcept
→ const Set<
String> -
The keys Laravel's
TrimStringsleaves as sent:current_password,passwordandpassword_confirmation. Extend it with{...TrimStringsMiddleware.defaultExcept, 'pin'}.