Address Copilot review feedback for phase‑4 handling - #12
Merged
Easton97-Jens merged 5 commits intoMay 14, 2026
Merged
Conversation
|
Easton97-Jens
deleted the
codex/fetch-and-evaluate-copilot-comments-for-pr-#377
branch
May 14, 2026 18:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Motivation
Description
intervention.loginto the request context when a phase‑4 JSON log file is configured to avoid unnecessary allocation and failure paths (src/ngx_http_modsecurity_module.c).open()failures (withngx_errno) when loadingmodsecurity_phase4_content_types_fileto aid diagnosis of permission/race errors (src/ngx_http_modsecurity_module.c).phase4_content_typefield from the request context to simplify the phase‑4 flow (src/ngx_http_modsecurity_common.h).wanted_actionreflects redirects vs denies by emittingredirectfor 3xx interventions anddenyotherwise (src/ngx_http_modsecurity_body_filter.c).ngx_write_fd()when writing phase‑4 JSON logs and log a warning / return error on short/failed writes to avoid silent data loss (src/ngx_http_modsecurity_body_filter.c).tests/modsecurity-phase4-invalid-config.t), requiremode_safespecifically (tests/modsecurity-phase4-modes.t), remove a duplicated regex branch (tests/modsecurity-phase4-content-types.t), and make the HTTP/2 proxy test daemon return a phase‑4 trigger response with an in‑scopeContent-Type: text/htmlso strict mode testing is valid (tests/modsecurity-proxy-h2.t).src/ngx_http_modsecurity_module.c).Testing
provefor the phase‑4 tests (tests/modsecurity-phase4-*.t, plus relatedtests/modsecurity*.t), but the environment lacks theTest::NginxPerl module, so the test run failed with "Can't locate Test/Nginx.pm" and no automated Test::Nginx tests executed.Address Copilot review feedback for phase4 handling.Codex Task