protected function get_release_asset_redirect( $asset, $aws = false ) {
		if ( ! $asset ) {
			return false;
		}

		// Unset release asset url if older than 5 min to account for AWS expiration.
		if ( $aws && ( time() - strtotime( '-12 hours', $this->response['timeout'] ) ) >= 300 ) {
			unset( $this->response['release_asset_redirect'] );
		}

		$response = isset( $this->response['release_asset_redirect'] ) ? $this->response['release_asset_redirect'] : false;

		if ( $this->exit_no_update( $response ) ) {
			return false;
		}

		if ( ! $response ) {
			add_action( 'requests-requests.before_redirect', [ $this, 'set_redirect' ], 10, 1 );
			add_filter( 'http_request_args', [ $this, 'set_aws_release_asset_header' ] );
			$url = $this->add_access_token_endpoint( $this, $asset );
			wp_remote_get( $url );
			remove_filter( 'http_request_args', [ $this, 'set_aws_release_asset_header' ] );
		}

		if ( ! empty( $this->redirect ) ) {
			$this->set_repo_cache( 'release_asset_redirect', $this->redirect );

			return $this->redirect;
		}

		return $response;
	}
protected function get_release_asset_redirect( $asset, $aws = false ) {
		if ( ! $asset ) {
			return false;
		}

		// Unset release asset url if older than 5 min to account for AWS expiration.
		if ( $aws && ( time() - strtotime( '-12 hours', $this->response['timeout'] ) ) >= 300 ) {
			unset( $this->response['release_asset_redirect'] );
		}

		$response = isset( $this->response['release_asset_redirect'] ) ? $this->response['release_asset_redirect'] : false;

		if ( $this->exit_no_update( $response ) ) {
			return false;
		}

		if ( ! $response ) {
			add_action( 'requests-requests.before_redirect', [ $this, 'set_redirect' ], 10, 1 );
			add_filter( 'http_request_args', [ $this, 'set_aws_release_asset_header' ] );
			$url = $this->add_access_token_endpoint( $this, $asset );
			wp_remote_get( $url );
			remove_filter( 'http_request_args', [ $this, 'set_aws_release_asset_header' ] );
		}

		if ( ! empty( $this->redirect ) ) {
			$this->set_repo_cache( 'release_asset_redirect', $this->redirect );

			return $this->redirect;
		}

		return $response;
	}
protected function get_release_asset_redirect ( $ asset , $ aws = false ) { if ( ! $ asset ) { return false ; } // Unset release asset url if older than 5 min to account for AWS expiration. if ( $ aws && ( time ( ) - strtotime ( '-12 hours' , $ this -> response [ 'timeout' ] ) ) >= 300 ) { unset ( $ this -> response [ 'release_asset_redirect' ] ) ; } $ response = isset ( $ this -> response [ 'release_asset_redirect' ] ) ? $ this -> response [ 'release_asset_redirect' ] : false ; if ( $ this -> exit_no_update ( $ response ) ) { return false ; } if ( ! $ response ) { add_action ( 'requests-requests.before_redirect' , [ $ this , 'set_redirect' ] , 10 , 1 ) ; add_filter ( 'http_request_args' , [ $ this , 'set_aws_release_asset_header' ] ) ; $ url = $ this -> add_access_token_endpoint ( $ this , $ asset ) ; wp_remote_get ( $ url ) ; remove_filter ( 'http_request_args' , [ $ this , 'set_aws_release_asset_header' ] ) ; } if ( ! empty ( $ this -> redirect ) ) { $ this -> set_repo_cache ( 'release_asset_redirect' , $ this -> redirect ) ; return $ this -> redirect ; } return $ response ; }
Return the redirect download link for a release asset.
AWS download link sets a link expiration of ONLY 5 minutes.

@since 6.1.0
@uses  Requests, requires WP 4.6

@param string $asset Release asset URI from git host.

@return string|bool|\stdClass Release asset URI from AWS.
Return the redirect download link for a release asset . AWS download link sets a link expiration of ONLY 5 minutes .