logging: hash query parameter values in QueryFilter#7884
Merged
francislavoie merged 1 commit intoJul 15, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Agent review by GitHub Copilot.
This pull request fixes QueryFilter’s hash action so it hashes each actual query parameter value (instead of always hashing an empty string), aligning behavior with the documentation and the existing cookie filter.
Changes:
- Update
QueryFilter.processQueryStringto hashq[a.Parameter][i](the actual per-value input) rather thana.Value. - Update the single-value query filter test to expect the SHA-256 prefix of the real input.
- Strengthen the multi-value test by using distinct inputs (
alpha/beta) and asserting distinct expected hashes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| modules/logging/filters.go | Fixes query parameter hashing to use the real parameter value. |
| modules/logging/filters_test.go | Updates/strengthens tests to validate correct per-value hashing behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
francislavoie
approved these changes
Jul 15, 2026
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.
Fixes #7883.
Summary
The query log filter currently passes the hash action's
Valuefield tohash. Because a hash action does not populate that field, every query parameter value is replaced with the hash of an empty string (e3b0c442).This change:
The behavior is now consistent with the query filter documentation and with the cookie filter, which already hashes the actual cookie value.
Testing
The updated tests failed against the original implementation with
e3b0c442, then passed after the production-code change.The following commands completed successfully:
Assistance Disclosure
AI-assisted using OpenAI Codex (GPT-5).
The issue was initially identified with AI assistance while reviewing a downstream Caddy configuration. I independently reproduced the behavior against unmodified v2.11.4 and current
mastercheckouts, inspected and understood the relevant implementation, verified the SHA-256 results, and performed a red-green regression-test workflow.AI assisted with the initial analysis, test planning, and wording. I reviewed and understand the code and tests in this pull request.