Skip to content

Commit 24fe81b

Browse files
committed
[dotnet] [bidi] Support implicit conversion from bytes to network bytes value
1 parent ff55efd commit 24fe81b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dotnet/src/webdriver/BiDi/Modules/Network/BytesValue.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using System;
2021
using System.Text.Json.Serialization;
2122

2223
namespace OpenQA.Selenium.BiDi.Modules.Network;
@@ -27,6 +28,7 @@ namespace OpenQA.Selenium.BiDi.Modules.Network;
2728
public abstract record BytesValue
2829
{
2930
public static implicit operator BytesValue(string value) => new StringBytesValue(value);
31+
public static implicit operator BytesValue(byte[] value) => new Base64BytesValue(Convert.ToBase64String(value));
3032
}
3133

3234
public record StringBytesValue(string Value) : BytesValue;

0 commit comments

Comments
 (0)