Skip to content

Commit

Permalink
Update 'VerificationIgnoredHeaders' property name
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrodasilvaalves committed Jul 2, 2023
1 parent 227436d commit bcc9082
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ IOptions<MockacoOptions> options
{
Route = httpContext.Request.Path.Value,
Timestamp = $"{DateTime.Now.ToString("t")}",
Headers = LoadHeaders(httpContext, options.Value.HiddenHeaders),
Headers = LoadHeaders(httpContext, options.Value.VerificationIgnoredHeaders),
Body = await httpContext.Request.ReadBodyStream()
}, DateTime.Now.AddMinutes(options.Value.MatchedRoutesCacheDuration));

Expand Down Expand Up @@ -111,10 +111,10 @@ private async Task LogHttpContext(HttpContext httpContext)
}
}

private static IEnumerable<object> LoadHeaders(HttpContext httpContext, IEnumerable<string> hiddenHeaders)
private static IEnumerable<object> LoadHeaders(HttpContext httpContext, IEnumerable<string> verificationIgnoredHeaders)
{
return from header in httpContext.Request.Headers.ToList()
where !hiddenHeaders.Any(opt => opt == header.Key)
where !verificationIgnoredHeaders.Any(opt => opt == header.Key)
select new { header.Key, Value = header.Value[0] };
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Mockaco.AspNetCore/Options/MockacoOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class MockacoOptions

public List<string> References { get; set; }

public List<string> HiddenHeaders { get; set; }
public List<string> VerificationIgnoredHeaders { get; set; }

public List<string> Imports { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions src/Mockaco.AspNetCore/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Mockaco.MockacoOptions.DefaultHttpStatusCode.get -> System.Net.HttpStatusCode
Mockaco.MockacoOptions.DefaultHttpStatusCode.set -> void
Mockaco.MockacoOptions.ErrorHttpStatusCode.get -> System.Net.HttpStatusCode
Mockaco.MockacoOptions.ErrorHttpStatusCode.set -> void
Mockaco.MockacoOptions.HiddenHeaders.get -> System.Collections.Generic.List<string>
Mockaco.MockacoOptions.HiddenHeaders.set -> void
Mockaco.MockacoOptions.VerificationIgnoredHeaders.get -> System.Collections.Generic.List<string>
Mockaco.MockacoOptions.VerificationIgnoredHeaders.set -> void
Mockaco.MockacoOptions.Imports.get -> System.Collections.Generic.List<string>
Mockaco.MockacoOptions.Imports.set -> void
Mockaco.MockacoOptions.MatchedRoutesCacheDuration.get -> int
Expand Down
2 changes: 1 addition & 1 deletion src/Mockaco/Settings/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ErrorHttpStatusCode": "NotImplemented",
"DefaultHttpContentType": "application/json",
"References": [],
"HiddenHeaders": [
"VerificationIgnoredHeaders": [
"Accept",
"Connection",
"Host",
Expand Down
2 changes: 1 addition & 1 deletion website/docs/verification/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ You can configure to not display headers that are not relevant to your test. By
```
"Mockaco": {
...
"HiddenHeaders": [
"VerificationIgnoredHeaders": [
"Postman-Token",
"Some-Irrelevant-Header",
],
Expand Down

0 comments on commit bcc9082

Please sign in to comment.