Cannot add value because header 'Authorization' does not support multiple values. #89
Open
6 tasks done
Labels
bug
Something isn't working
Checklist
Description
When I pass httpClient the OpenFgaApi and use CredentialsMethod.ApiToken authorization then I've got runtime exception about duplicated Authorization http header.
The exact exception:
Cannot add value because header 'Authorization' does not support multiple values.
Expectation
No exception thrown.
Reproduction
OpenFGA SDK version
Source code from 28.01.2025
OpenFGA version
Source code from 28.01.2025
SDK Configuration
According to the documentation
Logs
System.FormatException: Cannot add value because header 'Authorization' does not support multiple values.
at System.Net.Http.Headers.HttpHeaders.ParseAndAddValue(HeaderDescriptor descriptor, HeaderStoreItemInfo info, String value)
at System.Net.Http.Headers.HttpHeaders.Add(HeaderDescriptor descriptor, String value)
at System.Net.Http.Headers.HttpHeaders.Add(String name, String value)
at OpenFga.Sdk.ApiClient.BaseClient..ctor(Configuration configuration, HttpClient httpClient) in D:\Code\dotnet-sdk\src\OpenFga.Sdk\ApiClient\BaseClient.cs:line 55
at OpenFga.Sdk.ApiClient.ApiClient..ctor(Configuration configuration, HttpClient userHttpClient) in D:\Code\dotnet-sdk\src\OpenFga.Sdk\ApiClient\ApiClient.cs:line 39
at OpenFga.Sdk.Api.OpenFgaApi..ctor(Configuration configuration, HttpClient httpClient) in D:\Code\dotnet-sdk\src\OpenFga.Sdk\Api\OpenFgaApi.cs:line 35
at OpenFga.Sdk.Test.Api.OpenFgaApiTests.<>c__DisplayClass8_0.b__0() in D:\Code\dotnet-sdk\src\OpenFga.Sdk.Test\Api\OpenFgaApiTests.cs:line 104
at OpenFga.Sdk.Test.Api.OpenFgaApiTests.<>c__DisplayClass8_0.b__1() in D:\Code\dotnet-sdk\src\OpenFga.Sdk.Test\Api\OpenFgaApiTests.cs:line 108
at Xunit.Record.Exception(Func`1 testCode) in /_/src/xunit.core/Record.cs:line 47
References
No response
The text was updated successfully, but these errors were encountered: