From 3c0ee1aeba2680c58dfa76f630df74598e9ebb3f Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Wed, 2 Aug 2023 09:00:45 +0200 Subject: [PATCH] add actions pre running the http GET/POST requests /cc @mattwiebe --- includes/class-http.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/class-http.php b/includes/class-http.php index 1157137..e243997 100644 --- a/includes/class-http.php +++ b/includes/class-http.php @@ -20,6 +20,8 @@ class Http { * @return array|WP_Error The POST Response or an WP_ERROR */ public static function post( $url, $body, $user_id ) { + do_action( 'activitypub_pre_http_post', $url, $body, $user_id ); + $date = \gmdate( 'D, d M Y H:i:s T' ); $digest = Signature::generate_digest( $body ); $signature = Signature::generate_signature( $user_id, 'post', $url, $date, $digest ); @@ -68,6 +70,8 @@ class Http { * @return array|WP_Error The GET Response or an WP_ERROR */ public static function get( $url ) { + do_action( 'activitypub_pre_http_get', $url ); + $date = \gmdate( 'D, d M Y H:i:s T' ); $signature = Signature::generate_signature( Users::APPLICATION_USER_ID, 'get', $url, $date );