Skip to content

Commit

Permalink
Makes logic check both connection sandbox mode and request params for…
Browse files Browse the repository at this point in the history
… the dev flag

Previously logic was only considering the client sandbox mode.

This change allows passing this flag either as a request parameter or
specifying the sandbox mode for a connection.
  • Loading branch information
ZloeSabo committed Jun 29, 2020
1 parent 489c9be commit 15f1cc0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/kraken-net-v2/Http/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ internal async Task<IApiResponse<TResponse>> Execute<TResponse>(ApiRequest apiRe
{
apiRequest.Body.Authentication.ApiKey = _apiKey;
apiRequest.Body.Authentication.ApiSecret = _apiSecret;
apiRequest.Body.Dev = SandboxMode;
apiRequest.Body.Dev = SandboxMode || apiRequest.Body.Dev;
var isSet = apiRequest.Body is IOptimizeSetWaitRequest || apiRequest.Body is IOptimizeSetUploadWaitRequest;

using (var requestMessage = new HttpRequestMessage(apiRequest.Method, apiRequest.Uri))
Expand All @@ -102,7 +102,7 @@ internal async Task<IApiResponse<TResponse>> ExecuteUpload<TResponse>(

apiRequest.Body.Authentication.ApiKey = _apiKey;
apiRequest.Body.Authentication.ApiSecret = _apiSecret;
apiRequest.Body.Dev = SandboxMode;
apiRequest.Body.Dev = SandboxMode || apiRequest.Body.Dev;
var isSet = apiRequest.Body is IOptimizeSetWaitRequest || apiRequest.Body is IOptimizeSetUploadWaitRequest;

using (
Expand Down
6 changes: 3 additions & 3 deletions src/kraken-net/Http/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ internal async Task<IApiResponse<TResponse>> Execute<TResponse>(ApiRequest apiRe
{
apiRequest.Body.Authentication.ApiKey = _apiKey;
apiRequest.Body.Authentication.ApiSecret = _apiSecret;
apiRequest.Body.Dev = SandboxMode;
apiRequest.Body.Dev = SandboxMode || apiRequest.Body.Dev;
var isSet = apiRequest.Body is IOptimizeSetWaitRequest || apiRequest.Body is IOptimizeSetUploadWaitRequest;

using (var requestMessage = new HttpRequestMessage(apiRequest.Method, apiRequest.Uri))
{
var json = JsonConvert.SerializeObject(apiRequest.Body, _serializerSettings);
Expand All @@ -102,7 +102,7 @@ internal async Task<IApiResponse<TResponse>> ExecuteUpload<TResponse>(

apiRequest.Body.Authentication.ApiKey = _apiKey;
apiRequest.Body.Authentication.ApiSecret = _apiSecret;
apiRequest.Body.Dev = SandboxMode;
apiRequest.Body.Dev = SandboxMode || apiRequest.Body.Dev;
var isSet = apiRequest.Body is IOptimizeSetWaitRequest || apiRequest.Body is IOptimizeSetUploadWaitRequest;

using (
Expand Down

0 comments on commit 15f1cc0

Please sign in to comment.