make webfinger route available unsigned
This commit is contained in:
parent
b0edf9a765
commit
f79200ef27
1 changed files with 10 additions and 10 deletions
|
@ -79,16 +79,15 @@ class Server {
|
||||||
* @return mixed|\WP_Error
|
* @return mixed|\WP_Error
|
||||||
*/
|
*/
|
||||||
public static function authorize_activitypub_requests( $response, $handler, $request ) {
|
public static function authorize_activitypub_requests( $response, $handler, $request ) {
|
||||||
|
$route = $request->get_route();
|
||||||
$maybe_activitypub = $request->get_route();
|
if ( str_starts_with( $route, '/activitypub' ) ) {
|
||||||
if ( str_starts_with( $maybe_activitypub, '/activitypub' ) ) {
|
|
||||||
if ( 'POST' === $request->get_method() ) {
|
if ( 'POST' === $request->get_method() ) {
|
||||||
$verified_request = Signature::verify_http_signature( $request );
|
$verified_request = Signature::verify_http_signature( $request );
|
||||||
|
|
||||||
if ( \is_wp_error( $verified_request ) ) {
|
if ( \is_wp_error( $verified_request ) ) {
|
||||||
return $verified_request;
|
return $verified_request;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if ( '/activitypub/1.0/webfinger' !== $route ) {
|
||||||
// SecureMode/Authorized fetch.
|
// SecureMode/Authorized fetch.
|
||||||
$secure_mode = \get_option( 'activitypub_use_secure_mode', '0' );
|
$secure_mode = \get_option( 'activitypub_use_secure_mode', '0' );
|
||||||
if ( $secure_mode ) {
|
if ( $secure_mode ) {
|
||||||
|
@ -101,3 +100,4 @@ class Server {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue