diff --git a/src/Momento.Sdk/Internal/Middleware/HeaderMiddleware.cs b/src/Momento.Sdk/Internal/Middleware/HeaderMiddleware.cs index 68e28e6b..cb0aa8ee 100644 --- a/src/Momento.Sdk/Internal/Middleware/HeaderMiddleware.cs +++ b/src/Momento.Sdk/Internal/Middleware/HeaderMiddleware.cs @@ -11,9 +11,9 @@ namespace Momento.Sdk.Internal.Middleware { internal class Header { - public const string AuthorizationKey = "Authorization"; - public const string AgentKey = "Agent"; - public const string RuntimeVersionKey = "Runtime_Version"; + public const string AuthorizationKey = "authorization"; + public const string AgentKey = "agent"; + public const string RuntimeVersionKey = "runtime-version"; public readonly List onceOnlyHeaders = new List { Header.AgentKey, Header.RuntimeVersionKey }; public string Name; public string Value; diff --git a/src/Momento.Sdk/Internal/ScsDataClient.cs b/src/Momento.Sdk/Internal/ScsDataClient.cs index eda0b5a5..59e64383 100644 --- a/src/Momento.Sdk/Internal/ScsDataClient.cs +++ b/src/Momento.Sdk/Internal/ScsDataClient.cs @@ -35,7 +35,7 @@ public ScsDataClientBase(IConfiguration config, string authToken, string endpoin this._logger = config.LoggerFactory.CreateLogger(); this._exceptionMapper = new CacheExceptionMapper(config.LoggerFactory); } - + internal Task EagerConnectAsync(TimeSpan eagerConnectionTimeout) { return this.grpcManager.EagerConnectAsync(eagerConnectionTimeout); @@ -43,13 +43,14 @@ internal Task EagerConnectAsync(TimeSpan eagerConnectionTimeout) protected Metadata MetadataWithCache(string cacheName) { - if (this.hasSentOnetimeHeaders) { + if (this.hasSentOnetimeHeaders) + { return new Metadata() { { "cache", cacheName } }; } this.hasSentOnetimeHeaders = true; string sdkVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); string runtimeVer = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription; - return new Metadata() { { "cache", cacheName }, { "Agent", $"dotnet:cache:{sdkVersion}" }, { "Runtime-Version", runtimeVer } }; + return new Metadata() { { "cache", cacheName }, { "agent", $"dotnet:cache:{sdkVersion}" }, { "runtime-version", runtimeVer } }; } protected DateTime CalculateDeadline() { @@ -998,8 +999,8 @@ private async Task SendSetFetchAsync(string cacheName, st return this._logger.LogTraceCollectionRequestSuccess(REQUEST_TYPE_SET_FETCH, cacheName, setName, new CacheSetFetchResponse.Miss()); } - - + + const string REQUEST_TYPE_SET_SAMPLE = "SET_SAMPLE"; private async Task SendSetSampleAsync(string cacheName, string setName, ulong limit) { @@ -1023,7 +1024,7 @@ private async Task SendSetSampleAsync(string cacheName, return this._logger.LogTraceCollectionRequestSuccess(REQUEST_TYPE_SET_SAMPLE, cacheName, setName, new CacheSetSampleResponse.Miss()); } - + const string REQUEST_TYPE_SET_LENGTH = "SET_LENGTH"; private async Task SendSetLengthAsync(string cacheName, string setName) { diff --git a/src/Momento.Sdk/Internal/ScsTokenClient.cs b/src/Momento.Sdk/Internal/ScsTokenClient.cs index d7e2b97c..e9079a6d 100644 --- a/src/Momento.Sdk/Internal/ScsTokenClient.cs +++ b/src/Momento.Sdk/Internal/ScsTokenClient.cs @@ -32,16 +32,17 @@ public ScsTokenClient(IAuthConfiguration config, string authToken, string endpoi this._logger = config.LoggerFactory.CreateLogger(); this._exceptionMapper = new CacheExceptionMapper(config.LoggerFactory); } - + private Metadata Metadata() { - if (this.hasSentOnetimeHeaders) { + if (this.hasSentOnetimeHeaders) + { return new Metadata(); } this.hasSentOnetimeHeaders = true; string sdkVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); string runtimeVer = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription; - return new Metadata() { { "Agent", $"dotnet:auth:{sdkVersion}" }, { "Runtime-Version", runtimeVer } }; + return new Metadata() { { "agent", $"dotnet:auth:{sdkVersion}" }, { "runtime-version", runtimeVer } }; } private DateTime CalculateDeadline() diff --git a/src/Momento.Sdk/Internal/ScsTopicClient.cs b/src/Momento.Sdk/Internal/ScsTopicClient.cs index 0fd90ae6..9db9b2d7 100644 --- a/src/Momento.Sdk/Internal/ScsTopicClient.cs +++ b/src/Momento.Sdk/Internal/ScsTopicClient.cs @@ -33,13 +33,14 @@ public ScsTopicClientBase(ITopicConfiguration config, string authToken, string e private Metadata MetadataWithCache(string cacheName) { - if (this.hasSentOnetimeHeaders) { + if (this.hasSentOnetimeHeaders) + { return new Metadata() { { "cache", cacheName } }; } this.hasSentOnetimeHeaders = true; string sdkVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); string runtimeVer = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription; - return new Metadata() { { "cache", cacheName }, { "Agent", $"dotnet:topic:{sdkVersion}" }, { "Runtime-Version", runtimeVer } }; + return new Metadata() { { "cache", cacheName }, { "agent", $"dotnet:topic:{sdkVersion}" }, { "runtime-v]ersion", runtimeVer } }; } protected DateTime CalculateDeadline()