Skip to content

Commit

Permalink
[csharp-netcore] fix: url escaping (#12739)
Browse files Browse the repository at this point in the history
* fix: url escaping

* doc: add Polly to dependencies

* Revert "doc: add Polly to dependencies"

This reverts commit 29b95ed.
  • Loading branch information
Anakael authored Jun 30, 2022
1 parent c982421 commit 280de38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{>partial_header}}
using System;
using System.Collections.Generic;
using System.Web;

namespace {{packageName}}.Client
{
Expand All @@ -22,7 +22,7 @@ namespace {{packageName}}.Client
{
foreach (var parameter in parameters)
{
_path = _path.Replace("{" + parameter.Key + "}", HttpUtility.UrlEncode(parameter.Value));
_path = _path.Replace("{" + parameter.Key + "}", Uri.EscapeDataString(parameter.Value));
}
}

Expand All @@ -32,7 +32,7 @@ namespace {{packageName}}.Client
{
foreach (var value in parameter.Value)
{
_query = _query + parameter.Key + "=" + HttpUtility.UrlEncode(value) + "&";
_query = _query + parameter.Key + "=" + Uri.EscapeDataString(value) + "&";
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Generated by: https://github.com/openapitools/openapi-generator.git
*/

using System;
using System.Collections.Generic;
using System.Web;

namespace Org.OpenAPITools.Client
{
Expand All @@ -30,7 +30,7 @@ public void AddPathParameters(Dictionary<string, string> parameters)
{
foreach (var parameter in parameters)
{
_path = _path.Replace("{" + parameter.Key + "}", HttpUtility.UrlEncode(parameter.Value));
_path = _path.Replace("{" + parameter.Key + "}", Uri.EscapeDataString(parameter.Value));
}
}

Expand All @@ -40,7 +40,7 @@ public void AddQueryParameters(Multimap<string, string> parameters)
{
foreach (var value in parameter.Value)
{
_query = _query + parameter.Key + "=" + HttpUtility.UrlEncode(value) + "&";
_query = _query + parameter.Key + "=" + Uri.EscapeDataString(value) + "&";
}
}
}
Expand Down

0 comments on commit 280de38

Please sign in to comment.