add path to route (#438)
* add path to route fix #421 * added changelog entry
This commit is contained in:
parent
0763316009
commit
4a94eae877
3 changed files with 17 additions and 6 deletions
|
@ -107,9 +107,10 @@ Project maintained on GitHub at [automattic/wordpress-activitypub](https://githu
|
||||||
|
|
||||||
### Next ###
|
### Next ###
|
||||||
|
|
||||||
* Compatibility: allow deactivating blocks registered by the plugin.
|
* Compatibility: allow deactivating blocks registered by the plugin
|
||||||
* Compatibility: avoid Fatal Errors when using ClassicPress.
|
* Compatibility: avoid Fatal Errors when using ClassicPress
|
||||||
* Fixed: fix a typo in a hook name.
|
* Fixed: fix a typo in a hook name
|
||||||
|
* Fixed: a problem with signatures when running WordPress in a sub-path
|
||||||
|
|
||||||
### 1.0.0 ###
|
### 1.0.0 ###
|
||||||
|
|
||||||
|
|
|
@ -238,6 +238,15 @@ class Signature {
|
||||||
} else {
|
} else {
|
||||||
$route = '/' . rest_get_url_prefix() . '/' . ltrim( $request->get_route(), '/' );
|
$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->get_headers();
|
||||||
$headers['(request-target)'][0] = strtolower( $request->get_method() ) . ' ' . $route;
|
$headers['(request-target)'][0] = strtolower( $request->get_method() ) . ' ' . $route;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -107,9 +107,10 @@ Project maintained on GitHub at [automattic/wordpress-activitypub](https://githu
|
||||||
|
|
||||||
= Next =
|
= Next =
|
||||||
|
|
||||||
* Compatibility: allow deactivating blocks registered by the plugin.
|
* Compatibility: allow deactivating blocks registered by the plugin
|
||||||
* Compatibility: avoid Fatal Errors when using ClassicPress.
|
* Compatibility: avoid Fatal Errors when using ClassicPress
|
||||||
* Fixed: fix a typo in a hook name.
|
* Fixed: fix a typo in a hook name
|
||||||
|
* Fixed: a problem with signatures when running WordPress in a sub-path
|
||||||
|
|
||||||
= 1.0.0 =
|
= 1.0.0 =
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue