Skip to content

Commit 409cf14

Browse files
committed
Getter and setter for headers instead of autoprop
1 parent 16f63ad commit 409cf14

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Scripts/Connection/WSConnector.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,19 @@ public TextMessage(string text, Dictionary<string, string> headers = null)
158158
/// <summary>
159159
/// Headers to pass when making the socket.
160160
/// </summary>
161-
public Dictionary<string, string> Headers { get; set; }
161+
private Dictionary<string, string> _headers;
162+
public Dictionary<string, string> Headers {
163+
get
164+
{
165+
if (_headers == null)
166+
_headers = new Dictionary<string, string>();
167+
return _headers;
168+
}
169+
set
170+
{
171+
_headers = value;
172+
}
173+
}
162174
/// <summary>
163175
/// Credentials used to authenticate with the server.
164176
/// </summary>

0 commit comments

Comments
 (0)