Skip to content

Commit f7155de

Browse files
author
Kevin Hellemun
committed
Adde constant for magic value. (#49)
1 parent 6c97a23 commit f7155de

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

BunqSdk/Security/SecurityUtils.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ public class SecurityUtils
7878
/// Number of the very first index in an array or a string.
7979
/// </summary>
8080
private const int INDEX_FIRST = 0;
81+
82+
/// <summary>
83+
/// The index after the firts character in a string.
84+
/// </summary>
85+
private const int INDEX_LAST_FIRST_CHAR = 1;
8186

8287
/// <summary>
8388
/// Regex constants.
@@ -136,7 +141,7 @@ private static string GenerateRequestHeadersSortedString(HttpRequestMessage requ
136141
private static string GetHeaderNameCorrectyCased(string headerName)
137142
{
138143
headerName = headerName.ToLower();
139-
headerName = headerName.First().ToString().ToUpper() + headerName.Substring(1);
144+
headerName = headerName.First().ToString().ToUpper() + headerName.Substring(INDEX_LAST_FIRST_CHAR);
140145
var matches = Regex.Matches(headerName, REGEX_FOR_LOWERCASE_HEADERS);
141146

142147
return matches.Cast<Match>().Aggregate(

0 commit comments

Comments
 (0)