/// <inheritdoc />
    protected override async Task <HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    {
        if (_options.OnSend != null)
        {
            await _options.OnSend(request).ConfigureAwait(false);
        }

        var response = await _options.GetResponseAsync(request, cancellationToken).ConfigureAwait(false);

        if (response == null && _options.OnMissingRegistration != null)
        {
            response = await _options.OnMissingRegistration(request).ConfigureAwait(false);
        }

        if (response != null)
        {
            return(response);
        }

        if (_options.ThrowOnMissingRegistration)
        {
#pragma warning disable CA1062
            throw new HttpRequestNotInterceptedException(
                      $"No HTTP response is configured for {request.Method.Method} {request.RequestUri}.",
                      request);
#pragma warning restore CA1062
        }

        return(await base.SendAsync(request, cancellationToken).ConfigureAwait(false));
    }