Skip to content

Commit

Permalink
fix: Access-Control-Expose-Headers only set on preflight (#84)
Browse files Browse the repository at this point in the history
`Access-Control-Expose-Headers` should be only the full request, NOT the preflight:

> An HTTP response to a CORS request that is not a CORS-preflight request can also include the following header

https://fetch.spec.whatwg.org/#http-access-control-expose-headers
  • Loading branch information
griest024 authored Feb 7, 2024
1 parent 1e8ec61 commit f2515c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Response/HeaderProvider/CorsExposeHeadersProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ public function getValue()

public function canApply(): bool
{
return $this->validator->isPreflightRequest() && $this->validator->originIsValid() && $this->getValue();
return !$this->validator->isPreflightRequest() && $this->validator->originIsValid() && $this->getValue();
}
}

0 comments on commit f2515c8

Please sign in to comment.