add path to route (#438)

* add path to route

fix #421

* added changelog entry
This commit is contained in:
Matthias Pfefferle 2023-09-21 09:04:51 +02:00 committed by GitHub
parent 0763316009
commit 4a94eae877
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 6 deletions

View file

@ -107,9 +107,10 @@ Project maintained on GitHub at [automattic/wordpress-activitypub](https://githu
### Next ###
* Compatibility: allow deactivating blocks registered by the plugin.
* Compatibility: avoid Fatal Errors when using ClassicPress.
* Fixed: fix a typo in a hook name.
* Compatibility: allow deactivating blocks registered by the plugin
* Compatibility: avoid Fatal Errors when using ClassicPress
* Fixed: fix a typo in a hook name
* Fixed: a problem with signatures when running WordPress in a sub-path
### 1.0.0 ###

View file

@ -238,6 +238,15 @@ class Signature {
} else {
$route = '/' . rest_get_url_prefix() . '/' . ltrim( $request->get_route(), '/' );
}
// fix route for subdirectory installs
$path = wp_parse_url( get_home_url(), PHP_URL_PATH );
$path = trim( $path, '/' );
if ( $path ) {
$route = '/' . $path . $route;
}
$headers = $request->get_headers();
$headers['(request-target)'][0] = strtolower( $request->get_method() ) . ' ' . $route;
} else {

View file

@ -107,9 +107,10 @@ Project maintained on GitHub at [automattic/wordpress-activitypub](https://githu
= Next =
* Compatibility: allow deactivating blocks registered by the plugin.
* Compatibility: avoid Fatal Errors when using ClassicPress.
* Fixed: fix a typo in a hook name.
* Compatibility: allow deactivating blocks registered by the plugin
* Compatibility: avoid Fatal Errors when using ClassicPress
* Fixed: fix a typo in a hook name
* Fixed: a problem with signatures when running WordPress in a sub-path
= 1.0.0 =