Skip to content

Commit

Permalink
Ran dotnet format on code base
Browse files Browse the repository at this point in the history
  • Loading branch information
jamie-taylor-rjj committed May 30, 2024
1 parent 0462557 commit 637d644
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions OwaspHeaders.Core.Tests/HttpContextExtensionsTests/TryAdd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public void DoesntInjectHeader_When_Present()
// the setup stage of a test).
// So we'll disable the warning here then immediately restore it
// after we've done what we need to.
#pragma warning disable ASP0019
#pragma warning disable ASP0019
_context.Response.Headers.Add(headerName, headerBody);
#pragma warning restore ASP0019
#pragma warning restore ASP0019

// Act
var response = _context.TryAddHeader(headerName, headerBody);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ public void CanRemoveHeader_When_Present()
// Arrange
var headerName = Guid.NewGuid().ToString();
var headerBody = Guid.NewGuid().ToString();

// ASP0019 states that:
// "IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key."
// However, we've already done a check to see whether the
// Response.Headers object cannot contain this header (as we're in
// the setup stage of a test).
// So we'll disable the warning here then immediately restore it
// after we've done what we need to.
#pragma warning disable ASP0019
#pragma warning disable ASP0019
_context.Response.Headers.Add(headerName, headerBody);
#pragma warning restore ASP0019
#pragma warning restore ASP0019

// Act
var response = _context.TryRemoveHeader(headerName);
Expand Down
4 changes: 2 additions & 2 deletions src/Extensions/HttpContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public static bool TryAddHeader(this HttpContext httpContext, string headerName,
// already contains a header with this name (in the above if statement).
// So we'll disable the warning here then immediately restore it
// after we've done what we need to.
#pragma warning disable ASP0019
#pragma warning disable ASP0019
httpContext.Response.Headers.Append(headerName, headerValue);
#pragma warning restore ASP0019
#pragma warning restore ASP0019
return true;
}
catch (ArgumentException)
Expand Down

0 comments on commit 637d644

Please # to comment.