Skip to content

Commit 087b0e2

Browse files
committed
Avoid setting authorization if not present
1 parent 29498b0 commit 087b0e2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/ElectronNET.API/Bridge/SocketIOConnection.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ internal class SocketIOConnection : ISocketConnection
1919

2020
public SocketIOConnection(string uri, string authorization)
2121
{
22-
_socket = new SocketIO(uri, new SocketIOOptions
22+
var opts = string.IsNullOrEmpty(authorization) ? new SocketIOOptions() : new SocketIOOptions
2323
{
2424
ExtraHeaders = new Dictionary<string, string>
2525
{
2626
["authorization"] = authorization
2727
},
28-
});
28+
};
29+
_socket = new SocketIO(uri, opts);
2930
_socket.Serializer = new SystemTextJsonSerializer(ElectronJson.Options);
3031
// Use default System.Text.Json serializer from SocketIOClient.
3132
// Outgoing args are normalized to camelCase via SerializeArg in Emit.

src/ElectronNET.API/Runtime/Services/ElectronProcess/ElectronProcessActive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private async Task StartInternal(string startCmd, string args, string directoriy
160160
var tcs = new TaskCompletionSource();
161161

162162
void Read_SocketIO_Port(object sender, string line)
163-
{
163+
{
164164
// Look for "Electron Socket: listening on port %s at"
165165
var prefix = "Electron Socket: listening on port ";
166166

0 commit comments

Comments
 (0)