Skip to content

Bufix/220 null ref when bool explicitly set#221

Merged
jamie-taylor-rjj merged 7 commits into
mainfrom
bufix/220-null-ref-when-bool-explicitly-set
May 27, 2026
Merged

Bufix/220 null ref when bool explicitly set#221
jamie-taylor-rjj merged 7 commits into
mainfrom
bufix/220-null-ref-when-bool-explicitly-set

Conversation

@jamie-taylor-rjj

Copy link
Copy Markdown
Collaborator

Rationale for this PR

This PR attempts to fix the bug reported in #220 by validating the state of the middleware configuration using a naive approach: is there a non-null POCO for each flag set to true?

Whilst this PR achieves the validation, it does not stop the situation from happening in the first place as this would be an API surface change and we'll push that to the next major version.

PR Checklist

Feel free to either check the following items (by place an x inside of the square brackets) or by replacing the square brackets with a relevant emoji from the following list:

  • ✅ to indicate that you have checked something off
  • ❎ to indicate that you haven't checked something off
  • ❓ to indicate that something might not be relevant (writing tests for documentation changes, for instance)

Essential

These items are essential and must be completed for each commit. If they are not completed, the PR may not be accepted.

  • [ ✅ ] I have added tests to the OwaspHeaders.Core.Tests project
  • [ ✅ ] I have run the dotnet-format command and fixed any .editorconfig issues
  • [ ✅ ] I have ensured that the code coverage has not dropped below 65%
  • [ ✅ ] I have increased the version number in OwaspHeaders.Core.csproj (only relevant for code changes)
  • [ ✅ ] I have updated the changelog in the root of the repository
  • [ ✅ ] I have avoided using primary constructors in the example project (see README for details)

Note

The changelog in the docs/ directory will be updated automatically when PRs are merged into main

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
OwaspHeaders.Core 90% 75% 511
OwaspHeaders.Core 90% 75% 511
OwaspHeaders.Core 90% 75% 511
Summary 90% (3036 / 3372) 75% (840 / 1122) 1533

@jamie-taylor-rjj jamie-taylor-rjj self-assigned this May 27, 2026
@jamie-taylor-rjj jamie-taylor-rjj merged commit b54fda6 into main May 27, 2026
6 checks passed
@jamie-taylor-rjj jamie-taylor-rjj deleted the bufix/220-null-ref-when-bool-explicitly-set branch May 27, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants