Skip to content

Commit bb4ba17

Browse files
fix(ConfigurableMessageHandler): Fix quota project validation
1 parent e02d17a commit bb4ba17

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Src/Support/Google.Apis.Core/Http/ConfigurableMessageHandler.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -655,14 +655,15 @@ bool DisposeAndReturnFalse(IDisposable disposable)
655655
}
656656

657657
return response;
658-
}
659658

660-
private void CheckValidAfterInterceptors(HttpRequestMessage request)
661-
{
662-
if (request.Headers.Contains(QuotaProjectHeaderName))
659+
void CheckValidAfterInterceptors(HttpRequestMessage request)
663660
{
664-
throw new InvalidOperationException($"{QuotaProjectHeaderName} header can only be added through the credential or through the <Product>ClientBuilder.");
661+
if (triesRemaining == maxRetries && request.Headers.Contains(QuotaProjectHeaderName))
662+
{
663+
throw new InvalidOperationException($"{QuotaProjectHeaderName} header can only be added through the credential or through the <Product>ClientBuilder.");
664+
}
665665
}
666+
666667
}
667668

668669
private async Task CredentialInterceptAsync(HttpRequestMessage request, CancellationToken cancellationToken)

0 commit comments

Comments
 (0)