Skip to content

Commit

Permalink
fix Codacy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
m.scharrig committed May 17, 2018
1 parent 6f5af4a commit c3e0e2f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions RestSharp/Authenticators/OAuth/OAuthTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,19 @@ public static string GetTimestamp(DateTime dateTime)
public static string UrlEncodeRelaxed(string value)
{
// Escape RFC 3986 chars first.
var escapedRfc3986 = new StringBuilder(value);
for (var i = 0; i < uriRfc3986CharsToEscape.Length; i++)
{
var t = uriRfc3986CharsToEscape[i];

value = value.Replace(t, uriRfc3968EscapedHex[i]);
escapedRfc3986.Replace(t, uriRfc3968EscapedHex[i]);
}

// Do RFC 2396 escaping by calling the .NET method to do the work.
var escaped = new StringBuilder(Uri.EscapeDataString(value));
string escapedRfc2396 = Uri.EscapeDataString(escapedRfc3986.ToString());

// Return the fully-RFC3986-escaped string.
return escaped.ToString();
return escapedRfc2396;
}

/// <summary>
Expand Down

0 comments on commit c3e0e2f

Please sign in to comment.