Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add net 8 #94

Merged
merged 6 commits into from
May 30, 2024
Merged

Conversation

jamie-taylor-rjj
Copy link
Collaborator

Rationale For This PR

This library didn't explicitly support .NET 8 out of the box. .NET was released in November of 2023, so it was time to support it.

This PR adds support for .NET 8 to both OwaspHeaders.Core and the Tests library. It also contains a version bump to 8.1.0 - the rationale for the version bump as a minor version change is that this doesn't represent a major change in functionality (unless consumers are using .NET8, that is).

Warnings

The following warnings have been explicitly disabled in this PR:

  • ASP0019

ASP0019 is related to calling Repsonse.Headers.Add(string, string) on the HttpContext object and states:

IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key

This warning can be safely ignored because injecting a header with the same name in the three places where this warning occurs is very difficult to do. In fact, the two places where it happens in the OwaspHeaders.Test project would require code changes to make it happen, and if that happens then the tests will fail anyway.

It's not impossible for this to happen in the the actually library code (i.e. at public static bool ResponseContainsHeader(this HttpContext httpContext, string header) in Extensions/HttpContextExtensions.cs), but making it happen would require some precise timing and thread unsafe code. It's possible, but would be hard to do.

Copy link
Owner

@GaProgMan GaProgMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get this merged

@GaProgMan GaProgMan merged commit 31f75c1 into GaProgMan:main May 30, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants