mezzio/mezzio-cors

Explicit option in the route options

cookieseller opened this issue · 3 comments

Bug Report

It seems that the explicit option does currently not work and will always be overwritten.

Q A
Version(s) 1.0.1

Summary

Explicit route options are not possible and thus project config will always overwrite route config.

Current behavior

Setting the explicit option on a route is not possible, as it will always be overwritten by the ConfigurationLocator

How to reproduce

The example provided in "Enable Project Merging" should already fail, as "explicit" is overwritten due to

private function explicit(array $allowedMethods): bool
{
    return $allowedMethods === CorsMetadata::ALLOWED_REQUEST_METHODS;
}

failing if $allowedMethods is i.e. only 'GET'

Expected behavior

If explicit is set on a route it should not be overwritten.

Hey @cookieseller,

thanks for reporting that issue!
I've created a potential bugfix in #10
Would you mind testing your use-case with that fix and give me feedback after that?

This works perfectly yes, it does however expose another minor bug, but I'll open another issue for that. Thanks a lot for the quick fix.

Closed by #10