Skip to content

Conversation

dogawaf
Copy link
Contributor

@dogawaf dogawaf commented May 12, 2023

If the route prefix is /api, Slim must not boot for an url like /api-external.

In order to fix that, the route prefix is now matched like /api/.

The only downside is that /api (without trailing slash) is not handled by Slim anymore.

If the route prefix is `/api`, Slim must not boot for an url like `/api-external`.

In order to fix that, the route prefix is know matched like `/api/`.

The only downside is that `/api` (without trailing slash) is not handled by Slim anymore.
@dogawaf dogawaf force-pushed the fix-prefix-match branch from 18d6ecc to f4da440 Compare May 15, 2023 07:10
@S3b0
Copy link
Contributor

S3b0 commented Aug 7, 2023

regexp would match also /api w/o trailing slash (which should not really matter as in most use cases this path is not used at all).
Anyhow, regexp: preg_match('/^' . preg_quote($prefix, '/') . '(\/.*)?$/i', $prefix).

@dogawaf
Copy link
Contributor Author

dogawaf commented Aug 7, 2023

What would be the use case for having a route responding directly with /api?

@sebastian-iffland
Copy link

No obvious use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants