Skip to content

Commit 7cf1f4c

Browse files
fix(ConfigurableMessageHandler): Clear quota project header on retry
1 parent e02d17a commit 7cf1f4c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,13 @@ bool DisposeAndReturnFalse(IDisposable disposable)
641641
}
642642
}
643643
}
644+
645+
if (triesRemaining > 0)
646+
{
647+
// The request object was modifed and needs to be cleaned up before retries, in particular the Quota Project
648+
// header must be unset so we can apply a fresh value.
649+
request.Headers.Remove(QuotaProjectHeaderName);
650+
}
644651
} while (triesRemaining > 0); // Not a successful status code but it was handled.
645652

646653
// If the response is null, we should throw the last exception.

0 commit comments

Comments
 (0)