Skip to content

Commit

Permalink
AspNetRequestCookieLayoutRenderer - Renamed private method parameter …
Browse files Browse the repository at this point in the history
…from excludeKeys to checkForExclude
  • Loading branch information
snakefoot committed Sep 20, 2019
1 parent 46dd0fc commit 59bbb92
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Shared/LayoutRenderers/AspNetRequestCookieLayoutRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,19 @@ protected override void DoAppend(StringBuilder builder, LogEventInfo logEvent)
var cookies = httpRequest.Cookies;
if (cookies?.Count > 0)
{
bool excludeKeys = (CookieNames == null || CookieNames.Count == 0) && Exclude?.Count > 0;
var cookieValues = GetCookieValues(cookies, excludeKeys);
bool checkForExclude = (CookieNames == null || CookieNames.Count == 0) && Exclude?.Count > 0;
var cookieValues = GetCookieValues(cookies, checkForExclude);
SerializePairs(cookieValues, builder, logEvent);
}
}

#if !ASP_NET_CORE
private IEnumerable<KeyValuePair<string, string>> GetCookieValues(HttpCookieCollection cookies, bool excludeKeys)
private IEnumerable<KeyValuePair<string, string>> GetCookieValues(HttpCookieCollection cookies, bool checkForExclude)
{
var cookieNames = CookieNames?.Count > 0 ? CookieNames : cookies.Keys.Cast<string>().ToList();
foreach (var cookieName in cookieNames)
{
if (excludeKeys && Exclude.Contains(cookieName))
if (checkForExclude && Exclude.Contains(cookieName))
continue;

var httpCookie = cookies[cookieName];
Expand Down Expand Up @@ -116,12 +116,12 @@ private IEnumerable<KeyValuePair<string, string>> GetCookieValues(HttpCookieColl
}
}
#else
private IEnumerable<KeyValuePair<string, string>> GetCookieValues(IRequestCookieCollection cookies, bool excludeKeys)
private IEnumerable<KeyValuePair<string, string>> GetCookieValues(IRequestCookieCollection cookies, bool checkForExclude)
{
var cookieNames = CookieNames?.Count > 0 ? CookieNames : cookies.Keys;
foreach (var cookieName in cookieNames)
{
if (excludeKeys && Exclude.Contains(cookieName))
if (checkForExclude && Exclude.Contains(cookieName))
continue;

if (!cookies.TryGetValue(cookieName, out var cookieValue))
Expand Down

0 comments on commit 59bbb92

Please sign in to comment.