CsrfOptionsType
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
CsrfOptionsType =
object
Defined in: src/http/middleware/CsrfOptions.ts:20
Plain settings shape for csrfProtection.
Properties
Section titled “Properties”allowedOrigins?
Section titled “allowedOrigins?”
readonlyoptionalallowedOrigins?:ReadonlyArray<string>
Defined in: src/http/middleware/CsrfOptions.ts:32
Extra full origins accepted by the origin check.
cookie?
Section titled “cookie?”
readonlyoptionalcookie?:CsrfCookieOptions
Defined in: src/http/middleware/CsrfOptions.ts:28
Cookie attributes. Defaults: Path=/, Secure, SameSite=Lax, HttpOnly=false.
cookieName?
Section titled “cookieName?”
readonlyoptionalcookieName?:string
Defined in: src/http/middleware/CsrfOptions.ts:24
Cookie name. Default 'csrf-token'.
formFieldName?
Section titled “formFieldName?”
readonlyoptionalformFieldName?:string
Defined in: src/http/middleware/CsrfOptions.ts:34
Also read the token from this urlencoded body field (classic forms). Default off.
headerName?
Section titled “headerName?”
readonlyoptionalheaderName?:string
Defined in: src/http/middleware/CsrfOptions.ts:26
Request header carrying the token. Default 'x-csrf-token'.
secret?
Section titled “secret?”
readonlyoptionalsecret?:string|Uint8Array
Defined in: src/http/middleware/CsrfOptions.ts:22
REQUIRED — HMAC key, at least 16 bytes (32 recommended).
verifyOrigin?
Section titled “verifyOrigin?”
readonlyoptionalverifyOrigin?:boolean
Defined in: src/http/middleware/CsrfOptions.ts:30
Also require a same-origin Origin/Referer on unsafe methods. Default true.
