Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* @contentstack/developer-ecosystem-pr-reviewers
.github/workflows/ @contentstack/security-admin
**/.snyk @contentstack/security-admin
**/CODEOWNERS @contentstack/security-admin
**/CODEOWNERS @contentstack/security-admin
**/.gitguardian.yaml @contentstack/security-admin
14 changes: 7 additions & 7 deletions Contentstack.Core/ContentstackClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@
}
catch (Exception ex)
{
throw ex;

Check warning on line 397 in Contentstack.Core/ContentstackClient.cs

View workflow job for this annotation

GitHub Actions / unit-test

Re-throwing caught exception changes stack information (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2200)

Check warning on line 397 in Contentstack.Core/ContentstackClient.cs

View workflow job for this annotation

GitHub Actions / unit-test

Re-throwing caught exception changes stack information (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2200)

Check warning on line 397 in Contentstack.Core/ContentstackClient.cs

View workflow job for this annotation

GitHub Actions / unit-test

Re-throwing caught exception changes stack information (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2200)

Check warning on line 397 in Contentstack.Core/ContentstackClient.cs

View workflow job for this annotation

GitHub Actions / unit-test

Re-throwing caught exception changes stack information (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2200)
}
}

Expand Down Expand Up @@ -597,22 +597,22 @@
/// <summary>
/// To set headers for Contentstack rest calls.
/// </summary>
/// <param name="key">header name.</param>
/// <param name="value">header value against given header name.</param>
/// <param name="headerName">header name.</param>
/// <param name="headerValue">header value against given header name.</param>
/// <example>
/// <code>
/// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
/// stack.SetHeader("custom_key", "custom_value");
/// </code>
/// </example>
// deepcode ignore NoHardcodedCredentials: false positive - method signature/parameter names, no actual hardcoded credential
public void SetHeader(string key, string value)
public void SetHeader(string headerName, string headerValue)
{
if (key != null & value != null)
if (headerName != null & headerValue != null)
{
if (this._LocalHeaders.ContainsKey(key))
this._LocalHeaders.Remove(key);
this._LocalHeaders.Add(key, value);
if (this._LocalHeaders.ContainsKey(headerName))
this._LocalHeaders.Remove(headerName);
this._LocalHeaders.Add(headerName, headerValue);
}

}
Expand Down
14 changes: 7 additions & 7 deletions Contentstack.Core/Models/Entry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ public String GetUid()
/// <summary>
/// Set headers.
/// </summary>
/// <param name="key">custom_header_key</param>
/// <param name="value">custom_header_value</param>
/// <param name="headerName">custom_header_key</param>
/// <param name="headerValue">custom_header_value</param>
/// <example>
/// <code>
/// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Expand All @@ -361,13 +361,13 @@ public String GetUid()
/// </code>
/// </example>
// deepcode ignore NoHardcodedCredentials: false positive - method signature/parameter names, no actual hardcoded credential
public void SetHeader(string key, string value)
public void SetHeader(string headerName, string headerValue)
{
if (key != null && value != null)
if (headerName != null && headerValue != null)
{
if (this._Headers.ContainsKey(key))
this._Headers.Remove(key);
this._Headers.Add(key, value);
if (this._Headers.ContainsKey(headerName))
this._Headers.Remove(headerName);
this._Headers.Add(headerName, headerValue);
}

}
Expand Down
10 changes: 5 additions & 5 deletions Contentstack.Core/Models/Query.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ public Query SetLocale(String Locale)
/// <summary>
/// To set headers for Contentstack.io Contentstack rest calls.
/// </summary>
/// <param name="key">header name.</param>
/// <param name="value">header value against given header name.</param>
/// <param name="headerName">header name.</param>
/// <param name="headerValue">header value against given header name.</param>
/// <example>
/// <code>
/// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Expand All @@ -221,11 +221,11 @@ public Query SetLocale(String Locale)
/// </code>
/// </example>
// deepcode ignore NoHardcodedCredentials: false positive - method signature/parameter names, no actual hardcoded credential
public void SetHeader(String key, String value)
public void SetHeader(String headerName, String headerValue)
{
if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(value))
if (!string.IsNullOrEmpty(headerName) && !string.IsNullOrEmpty(headerValue))
{
_Headers.Add(key, value);
_Headers.Add(headerName, headerValue);
}
}

Expand Down
Loading