Skip to content

Commit 1662a9d

Browse files
author
kenfullscale
committed
Change the logic in adding to a newly created dictionary for webrequest details.
1 parent ed9d11a commit 1662a9d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Src/StackifyLib.AspNetCore/WebRequestDetailMapper.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ internal static Dictionary<string, string> ToKeyValues(IEnumerable<KeyValuePair<
111111
{
112112
object val = item.Value.ToString();
113113

114-
if (val != null && string.IsNullOrWhiteSpace(val.ToString()) == false && items.ContainsKey(key))
114+
if (val != null && string.IsNullOrWhiteSpace(val.ToString()) == false && items.ContainsKey(key) == false)
115115
{
116116
AddKey(key, val.ToString(), items, goodKeys, badKeys);
117117
}
@@ -137,7 +137,7 @@ internal static Dictionary<string, string> ToKeyValues(IEnumerable<KeyValuePair<
137137
{
138138
object val = item.Value;
139139

140-
if (val != null && string.IsNullOrWhiteSpace(val.ToString()) == false && items.ContainsKey(key))
140+
if (val != null && string.IsNullOrWhiteSpace(val.ToString()) == false && items.ContainsKey(key) == false)
141141
{
142142
AddKey(key, val.ToString(), items, goodKeys, badKeys);
143143
}
@@ -166,8 +166,7 @@ internal static void AddKey(string key, string value, Dictionary<string, string>
166166
{
167167
return;
168168
}
169-
170-
dictionary[key] = value;
169+
dictionary.Add(key,value);
171170
}
172171
}
173172
}

0 commit comments

Comments
 (0)