Skip to content

Commit 8818868

Browse files
authored
Revert "Always remove filter maybe_double_knock http_response fil… (#1991)
1 parent 0ce46de commit 8818868

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

includes/class-signature.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ public static function verify_http_signature( $request ) {
8585
* @return array The HTTP response.
8686
*/
8787
public static function maybe_double_knock( $response, $args, $url ) {
88-
// Remove this filter to prevent infinite recursion.
89-
\remove_filter( 'http_response', array( self::class, 'maybe_double_knock' ) );
90-
9188
// Bail if there's nothing to sign with. It's likely an unrelated request getting processed first.
9289
if ( ! isset( $args['key_id'], $args['private_key'], $args['headers']['Date'] ) ) {
9390
return $response;
9491
}
9592

93+
// Remove this filter to prevent infinite recursion.
94+
\remove_filter( 'http_response', array( self::class, 'maybe_double_knock' ) );
95+
9696
$response_code = \wp_remote_retrieve_response_code( $response );
9797

9898
// Fall back to Draft Cavage signature for any 4xx responses.

0 commit comments

Comments
 (0)