fix: preserve empty string values in URL plugin (GH #125)#382
Draft
toddr-bot wants to merge 1 commit intoabw:masterfrom
Draft
fix: preserve empty string values in URL plugin (GH #125)#382toddr-bot wants to merge 1 commit intoabw:masterfrom
toddr-bot wants to merge 1 commit intoabw:masterfrom
Conversation
The URL plugin's grep filter checked both defined() and length(), dropping params with empty string values. Per RFC 3986, empty query values are valid (e.g. ?empty=&other=x). Remove the length check so only undef values are excluded. Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.
What
Allow empty string values in URL plugin query parameters instead of silently dropping them.
Why
The
grepfilter inTemplate::Plugin::URL::new()checksdefined && length, which drops params with empty string values (""). Per RFC 3986 and CGI conventions,?empty=&other=xis valid — an empty value is distinct from an absent parameter. This breaks applications that rely on the presence of a key regardless of its value.Closes #125.
How
Removed the
lengthcheck from the grep filter, keeping only thedefinedcheck. This matches the fix proposed in the original issue report.Testing
t/url.tverifying empty string params are preserved in output🤖 Generated with Claude Code
Quality Report
Changes: 2 files changed, 8 insertions(+), 1 deletion(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline