Skip to content

Commit

Permalink
Fix naming http signature (#297) (#298)
Browse files Browse the repository at this point in the history
* fix namint http signature error



* update version to 1.3.7



---------

Signed-off-by: catcherwong <[email protected]>
  • Loading branch information
catcherwong authored Jul 11, 2024
1 parent 42fb0b5 commit 185362b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/version.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<NugetVersion>1.3.6</NugetVersion>
<NugetVersion>1.3.7</NugetVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Nacos/V2/Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class Constants
{
public static string CLIENT_VERSION = "Nacos-CSharp-Client:v1.3.5";
public static string CLIENT_VERSION = "Nacos-CSharp-Client:v1.3.7";

public const string ClientName = "NacosClient";

Expand Down
4 changes: 2 additions & 2 deletions src/Nacos/V2/Naming/Remote/Http/NamingHttpClientProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -493,15 +493,15 @@ private string InitParams(Dictionary<string, string> dict, Dictionary<string, st
{
foreach (var item in dict)
{
builder.Append($"{item.Key}={item.Value}&");
builder.Append($"{item.Key}={item.Value.UrlEncode()}&");
}
}

if (body != null && body.Any())
{
foreach (var item in body)
{
builder.Append($"{item.Key}={item.Value}&");
builder.Append($"{item.Key}={item.Value.UrlEncode()}&");
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/Nacos/V2/Utils/StringUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ public static bool IsNullOrWhiteSpace(this string str)

public static bool IsNotNullOrWhiteSpace(this string str)
=> !string.IsNullOrWhiteSpace(str);

public static string UrlEncode(this string str)
=> System.Net.WebUtility.UrlEncode(str);
}
}

0 comments on commit 185362b

Please sign in to comment.