Skip to content

Commit fd404d8

Browse files
📝 Add docstrings to patch-1
Docstrings generation was requested by @amaitland. * #5120 (comment) The following files were modified: * `CefSharp/PostDataExtensions.cs`
1 parent 58665d5 commit fd404d8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

CefSharp/PostDataExtensions.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,16 @@ public static string GetCharSet(this IRequest request)
7777
/// </summary>
7878
/// <param name="postDataElement">post data</param>
7979
/// <param name="charSet">character set</param>
80-
/// <returns>encoded string</returns>
80+
/// <summary>
81+
/// Decodes the byte content of a post data element into a string using the specified character set or the default encoding.
82+
/// </summary>
83+
/// <param name="postDataElement">The post data element containing the bytes to decode.</param>
84+
/// <param name="charSet">Optional character set name to use for decoding. If invalid or not provided, the default encoding is used.</param>
85+
/// <returns>The decoded string, or null if the byte content is null or empty.</returns>
8186
public static string GetBody(this IPostDataElement postDataElement, string charSet = null)
8287
{
8388
var bytes = postDataElement.Bytes;
84-
if (bytes.Length == 0)
89+
if (bytes is null || bytes.Length == 0)
8590
{
8691
return null;
8792
}

0 commit comments

Comments
 (0)