Skip to content

Commit

Permalink
Merge pull request #2 from ehsanehsani/master
Browse files Browse the repository at this point in the history
Update KuttApi.cs
  • Loading branch information
avestura authored Jun 7, 2019
2 parents bf8231e + d024592 commit 2c57c40
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions KuttSharp/KuttApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public KuttApi(string apiKey)
{
ApiKey = apiKey ?? throw new ArgumentNullException(nameof(apiKey));
KuttServer = new Uri(KuttDefaultServer);

client.DefaultRequestHeaders.Add("X-API-Key", apiKey);
if (!client.DefaultRequestHeaders.Contains("X-API-Key"))
client.DefaultRequestHeaders.Add("X-API-Key", apiKey);
}

/// <summary>
Expand All @@ -61,8 +61,8 @@ public KuttApi(string apiKey, Uri server)
{
ApiKey = apiKey ?? throw new ArgumentNullException(nameof(apiKey));
KuttServer = server ?? throw new ArgumentNullException(nameof(server));

client.DefaultRequestHeaders.Add("X-API-Key", apiKey);
if (!client.DefaultRequestHeaders.Contains("X-API-Key"))
client.DefaultRequestHeaders.Add("X-API-Key", apiKey);
}

/// <summary>
Expand All @@ -74,8 +74,8 @@ public KuttApi(string apiKey, string server)
{
ApiKey = apiKey ?? throw new ArgumentNullException(nameof(apiKey));
KuttServer = new Uri(server);

client.DefaultRequestHeaders.Add("X-API-Key", apiKey);
if (!client.DefaultRequestHeaders.Contains("X-API-Key"))
client.DefaultRequestHeaders.Add("X-API-Key", apiKey);
}

/// <summary>
Expand Down

0 comments on commit 2c57c40

Please sign in to comment.