mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-10 18:06:37 +02:00
Use Uri.EscapeDataString
in a few others places
This commit is contained in:
parent
6f877cf543
commit
fca6729ef0
1 changed files with 4 additions and 3 deletions
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscordChatExporter.Core.Utils;
|
||||
|
@ -25,8 +24,8 @@ public class UrlBuilder
|
|||
if (ignoreUnsetValue && string.IsNullOrWhiteSpace(value))
|
||||
return this;
|
||||
|
||||
var keyEncoded = WebUtility.UrlEncode(key);
|
||||
var valueEncoded = WebUtility.UrlEncode(value);
|
||||
var keyEncoded = Uri.EscapeDataString(key);
|
||||
var valueEncoded = Uri.EscapeDataString(value);
|
||||
_queryParameters[keyEncoded] = valueEncoded;
|
||||
|
||||
return this;
|
||||
|
@ -39,9 +38,11 @@ public class UrlBuilder
|
|||
buffer.Append(_path);
|
||||
|
||||
if (_queryParameters.Any())
|
||||
{
|
||||
buffer
|
||||
.Append('?')
|
||||
.AppendJoin('&', _queryParameters.Select(kvp => $"{kvp.Key}={kvp.Value}"));
|
||||
}
|
||||
|
||||
return buffer.ToString();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue