Skip to content

Commit

Permalink
Do Not Lowercase Config Names (#172)
Browse files Browse the repository at this point in the history
This causes unnecessary confusion if people are using the wrong name to
check things

kong tests: statsig-io/kong#3305
  • Loading branch information
sroyal-statsig authored Jan 29, 2025
1 parent c400f46 commit 58a4f98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dotnet-statsig/src/Statsig/Server/Evaluation/Evaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ internal ConfigEvaluation CheckGate(StatsigUser user, string gateName)
return new ConfigEvaluation(EvaluationResult.Fail, EvaluationReason.Unrecognized);
}

var spec = _store.FeatureGates.ContainsKey(gateName.ToLowerInvariant()) ? _store.FeatureGates[gateName.ToLowerInvariant()] : null;
var spec = _store.FeatureGates.ContainsKey(gateName) ? _store.FeatureGates[gateName] : null;

if (spec == null)
{
Expand Down Expand Up @@ -203,7 +203,7 @@ internal ConfigEvaluation GetConfig(StatsigUser user, string configName, Diction
return new ConfigEvaluation(EvaluationResult.Fail, EvaluationReason.Unrecognized);
}

var spec = _store.DynamicConfigs.ContainsKey(configName.ToLowerInvariant()) ? _store.DynamicConfigs[configName.ToLowerInvariant()] : null;
var spec = _store.DynamicConfigs.ContainsKey(configName) ? _store.DynamicConfigs[configName] : null;

if (spec == null)
{
Expand Down Expand Up @@ -250,7 +250,7 @@ internal ConfigEvaluation GetLayer(StatsigUser user, string layerName, Dictionar
return new ConfigEvaluation(EvaluationResult.Fail, EvaluationReason.Unrecognized);
}

var spec = _store.LayerConfigs.ContainsKey(layerName.ToLowerInvariant()) ? _store.LayerConfigs[layerName.ToLowerInvariant()] : null;
var spec = _store.LayerConfigs.ContainsKey(layerName) ? _store.LayerConfigs[layerName] : null;

if (spec == null)
{
Expand Down
6 changes: 3 additions & 3 deletions dotnet-statsig/src/Statsig/Server/Evaluation/SpecStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ private bool ParseResponse(string? response)
var gateSpec = ConfigSpec.FromJObject(gate);
if (gateSpec != null)
{
newGates[gateSpec.Name.ToLowerInvariant()] = gateSpec;
newGates[gateSpec.Name] = gateSpec;
}
}
catch
Expand All @@ -458,7 +458,7 @@ private bool ParseResponse(string? response)
var configSpec = ConfigSpec.FromJObject(config);
if (configSpec != null)
{
newConfigs[configSpec.Name.ToLowerInvariant()] = configSpec;
newConfigs[configSpec.Name] = configSpec;
}
}
catch
Expand All @@ -478,7 +478,7 @@ private bool ParseResponse(string? response)
var configSpec = ConfigSpec.FromJObject(config);
if (configSpec != null)
{
newLayerConfigs[configSpec.Name.ToLowerInvariant()] = configSpec;
newLayerConfigs[configSpec.Name] = configSpec;
}
}
catch
Expand Down

0 comments on commit 58a4f98

Please sign in to comment.