From fd404d83a7d3917ea15086b67d0959851adbdacb Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 20:53:24 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstrings=20to=20`patch-1?= =?UTF-8?q?`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docstrings generation was requested by @amaitland. * https://github.com/cefsharp/CefSharp/pull/5120#issuecomment-2976897880 The following files were modified: * `CefSharp/PostDataExtensions.cs` --- CefSharp/PostDataExtensions.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CefSharp/PostDataExtensions.cs b/CefSharp/PostDataExtensions.cs index 03a6d07765..9938e58ad7 100644 --- a/CefSharp/PostDataExtensions.cs +++ b/CefSharp/PostDataExtensions.cs @@ -77,11 +77,16 @@ public static string GetCharSet(this IRequest request) /// /// post data /// character set - /// encoded string + /// + /// Decodes the byte content of a post data element into a string using the specified character set or the default encoding. + /// + /// The post data element containing the bytes to decode. + /// Optional character set name to use for decoding. If invalid or not provided, the default encoding is used. + /// The decoded string, or null if the byte content is null or empty. public static string GetBody(this IPostDataElement postDataElement, string charSet = null) { var bytes = postDataElement.Bytes; - if (bytes.Length == 0) + if (bytes is null || bytes.Length == 0) { return null; }