File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ limitations under the License.
1717using Google . Apis . Util ;
1818using System . Collections . Generic ;
1919using System . Collections . ObjectModel ;
20+ using System . Linq ;
2021using System . Net . Http ;
2122using System . Net . Http . Headers ;
2223
@@ -78,6 +79,8 @@ public void AddHeaders(HttpRequestHeaders requestHeaders)
7879
7980 foreach ( var header in Headers )
8081 {
82+ // Overwite any pre-existing header with the provided values.
83+ requestHeaders . Remove ( header . Key ) ;
8184 requestHeaders . Add ( header . Key , header . Value ) ;
8285 }
8386 }
Original file line number Diff line number Diff line change @@ -641,6 +641,10 @@ bool DisposeAndReturnFalse(IDisposable disposable)
641641 }
642642 }
643643 }
644+
645+ // Reset the quota project here so we can validate a new project isn't specified by the interceptors.
646+ // In any case this will be repopulated by the credential interceptor.
647+ request . Headers . Remove ( QuotaProjectHeaderName ) ;
644648 } while ( triesRemaining > 0 ) ; // Not a successful status code but it was handled.
645649
646650 // If the response is null, we should throw the last exception.
You can’t perform that action at this time.
0 commit comments