Skip to content

Commit e19846e

Browse files
committed
optional accept-signature header in httpclient
1 parent 457a3be commit e19846e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Packages/Sequence-Unity/Sequence/SequenceSDK/EmbeddedWallet/SequenceLogin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public void SetupAuthenticator(IValidator validator = null, IAuthenticator authe
151151
}
152152

153153
_sessionId = IntentDataOpenSession.CreateSessionId(_sessionWallet.GetAddress());
154-
_intentSender = new IntentSender(new HttpClient(WaaSWithAuthUrl), _sessionWallet, _sessionId, _waasProjectId, _waasVersion);
154+
_intentSender = new IntentSender(new HttpClient(WaaSWithAuthUrl, true), _sessionWallet, _sessionId, _waasProjectId, _waasVersion);
155155

156156
if (authenticator != null)
157157
{

Packages/Sequence-Unity/Sequence/SequenceSDK/Utils/Networking/HttpClient.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ public class HttpClient : IHttpClient
2020
NullValueHandling = NullValueHandling.Ignore
2121
};
2222

23-
public HttpClient(string baseUrl)
23+
public HttpClient(string baseUrl, bool acceptSignature = false)
2424
{
2525
_baseUrl = baseUrl;
2626
_defaultHeaders = new Dictionary<string, string>();
2727
_defaultHeaders["Content-Type"] = "application/json";
2828
_defaultHeaders["Accept"] = "application/json";
29-
_defaultHeaders["Accept-Signature"] = "sig=()";
29+
30+
if (acceptSignature)
31+
_defaultHeaders["Accept-Signature"] = "sig=()";
3032
}
3133

3234
public async Task<TResponse> SendPostRequest<TArgs, TResponse>(string path, TArgs args, Dictionary<string, string> headers = null)

0 commit comments

Comments
 (0)