Skip to content

precondition

precondition(options?): Function

Defined in: http/precondition.js:43

Create a precondition enforcement middleware.

string[] | Set<string>

HTTP methods to enforce on. When omitted, enforces unconditionally (the pipeline builder handles method scoping). When provided, only activates for the specified methods.

Function

  • Middleware (req) => void that returns {response: {statusCode: 428}} if no conditional header is present