Skip to content

Commit

Permalink
better wp-json matching (doesn't match /wp-json-stuff)
Browse files Browse the repository at this point in the history
  • Loading branch information
broskees committed Jan 27, 2024
1 parent d11c068 commit bb9c5e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Roots/Acorn/Bootloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ protected function bootHttp(ApplicationContract $app)

if ($isWPRequest = $route->getName() === 'wordpress_request') {
$route->middleware(
str_starts_with($request->path(), 'wp-json')
preg_match('/^wp-json(\/.*)?/', $request->path())
? $app->config->get('router.wordpress.api', 'api')
: $app->config->get('router.wordpress.web', 'web')
);
Expand Down

0 comments on commit bb9c5e1

Please sign in to comment.