class RestrictHeadersToOrigin

Keep custom credentials removed after a redirect leaves their configured origin.

Guzzle strips Authorization and Cookie, but other headers can also carry credentials. Laravel MCP forwards those headers; redirects remain supported here without exposing them.

Properties

protected UriInterface $origin

Methods

__construct(string $url, array $headers)

Create middleware for the configured endpoint's custom headers.

__invoke(callable $handler)

Remove custom headers for the rest of a cross-origin redirect chain.

Details

at line 29
__construct(string $url, array $headers)

Create middleware for the configured endpoint's custom headers.

Parameters

string $url
array $headers

at line 37
Closure __invoke(callable $handler)

Remove custom headers for the rest of a cross-origin redirect chain.

Parameters

callable $handler

Return Value

Closure