Woody, Here's an example meeting your criteria (I think):
<?php namespace Example; use Psr\Http\Message\MessageInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Middleware\RequestMiddlewareInterface; use Psr\Http\Middleware\ResponseFactoryInterface; class AuthHeaderMiddleware implements RequestMiddlewareInterface, ResponseFactoryInterface { public function parseRequest(RequestInterface $request): MessageInterface { if ($request->getMethod() === 'POST' && $request->hasHeader( 'authorization')) { return $request; // Passthrough here } $response = $this->createResponseInstance(); return $response->withStatus(401); // short circuit handled by middleware runner implementing ExchangeInterface } } -- You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscr...@googlegroups.com. To post to this group, send email to php-fig@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/660a45e0-a2f6-4bbd-932d-d947cd141515%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.