Yoast\WP\SEO\MyYoast_Client\Infrastructure\DPoP

DPoP_Handler::handle_nonce_responsepublicYoast 1.0

Extracts and stores a DPoP-Nonce from response headers.

Метод класса: DPoP_Handler{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$DPoP_Handler = new DPoP_Handler();
$DPoP_Handler->handle_nonce_response( $response_headers ): void;
$response_headers(массив) (обязательный)
.

Код DPoP_Handler::handle_nonce_response() Yoast 27.7

public function handle_nonce_response( array $response_headers ): void {
	$nonce = $this->extract_header( $response_headers, 'dpop-nonce' );
	if ( $nonce === null ) {
		return;
	}

	// Transients are safe here: DPoP nonces are optional per RFC 9449 Section 4.1.
	// If the nonce is missing or stale, the server responds with `use_dpop_nonce`
	// and provides a fresh one. HTTP_Client retries automatically, so broken
	// transients only cause an extra round-trip, never a functional failure.
	// We use a generic key since the MyYoast server uses one nonce for all endpoints.
	\set_transient( $this->get_nonce_transient_key(), $nonce, self::NONCE_TTL_IN_SECONDS );
}