1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-20 00:43:36 +03:00

Add xmldocs for Extensions#EncodeHeader(string)

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-06-11 17:09:01 +05:00
parent f4738e5dd4
commit 2ee30ddfb8
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF

View file

@ -109,6 +109,12 @@ public static class Extensions {
return Messages.ResourceManager.GetString(key, Messages.Culture) ?? key; return Messages.ResourceManager.GetString(key, Messages.Culture) ?? key;
} }
/// <summary>
/// Encodes a string to allow its transmission in request headers.
/// </summary>
/// <remarks>Used when encountering "Request headers must contain only ASCII characters".</remarks>
/// <param name="s">The string to encode.</param>
/// <returns>An encoded string with spaces kept intact.</returns>
public static string EncodeHeader(this string s) { public static string EncodeHeader(this string s) {
return WebUtility.UrlEncode(s).Replace('+', ' '); return WebUtility.UrlEncode(s).Replace('+', ' ');
} }