api-platform icon indicating copy to clipboard operation
api-platform copied to clipboard

Caddyfile: Use enhanced expression matcher

Open francislavoie opened this issue 3 years ago • 1 comments

In Caddy v2.5.2 released last month, the expression matcher was upgraded in https://github.com/caddyserver/caddy/pull/4715 to embed the other main built-in matchers as functions inside of the CEL expressions.

This makes it possible to more elegantly configure the @pwa matcher in the API Platform Caddyfile.

I didn't test this, as I don't use APIP, but I think this should be correct.

Notably, this uses the expression syntax for header and path. In the case of the path matcher, it's case insensitive, so that replaces the (?i) in the regexp.

The docs in https://api-platform.com/docs/distribution/caddy/ will need to be updated as well, after this is merged.

francislavoie avatar Aug 07 '22 23:08 francislavoie

For the record, this can be tested locally by just running docker compose up.

Then load https://localhost and click on the buttons allowing to access the various API Platform components.

dunglas avatar Aug 08 '22 07:08 dunglas

I just tested the patch, and it works! Thanks @francislavoie.

dunglas avatar Sep 08 '22 10:09 dunglas