Skip to content

Commit

Permalink
Fixes REST API not working when LWT was running in root folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoFara committed Jan 8, 2024
1 parent c9a8b80 commit 2479e4a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function endpoint_exits($method, $requestUri)

// Extract requested endpoint from URI
$uri_query = parse_url($requestUri, PHP_URL_PATH);
$matching = preg_match('/(.+?\/api.php\/v\d\/).+/', $uri_query, $matches);
$matching = preg_match('/(.*?\/api\.php\/v\d\/).+/', $uri_query, $matches);
if (!$matching) {
send_response(400, ['error' => 'Unrecognized URL format ' . $uri_query]);
}
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Solves [#129](https://github.com/HugoFara/lwt/issues/129), thanks to the help of
* An explicit dependency to [php-dom](https://www.php.net/manual/en/book.dom.php) was
missing in `INSTALL.sh` (and `composer.json`), as stated in
[#178](https://github.com/HugoFara/lwt/pull/178).
* API: the REST API was not accessible for users running LWT in a root folder.

### Deprecated

Expand Down
1 change: 1 addition & 0 deletions docs/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -2362,6 +2362,7 @@ <h4>Fixed</h4>
<li>An explicit dependency to <a href="https://www.php.net/manual/en/book.dom.php">php-dom</a> was
missing in <code>INSTALL.sh</code> (and <code>composer.json</code>), as stated in
<a href="https://github.com/HugoFara/lwt/pull/178">#178</a>.</li>
<li>API: the REST API was not accessible for users running LWT in a root folder.</li>
</ul>
<h4>Deprecated</h4>
<ul>
Expand Down

0 comments on commit 2479e4a

Please sign in to comment.