Skip to content

fix: preserve plus signs in param flow rules#3628

Open
hutiefang76 wants to merge 1 commit into
alibaba:1.8from
hutiefang76:codex/sentinel-3505-param-plus
Open

fix: preserve plus signs in param flow rules#3628
hutiefang76 wants to merge 1 commit into
alibaba:1.8from
hutiefang76:codex/sentinel-3505-param-plus

Conversation

@hutiefang76

Copy link
Copy Markdown

Describe what this PR does / why we need it

When setting hotspot parameter flow rules through setParamFlowRules, values containing a literal plus sign are currently decoded twice. The HTTP command layer already decodes request parameters before they reach CommandRequest, so decoding data again changes + into a space and alters the configured hotspot item value.

Does this pull request fix one issue?

Fixes #3505

Describe how you did it

Removed the extra URLDecoder.decode(...) call from ModifyParamFlowRulesCommandHandler and added a regression test that submits already-decoded rule JSON with a hotspot item value of a+b.

Describe how to verify it

JAVA_HOME=$(/usr/libexec/java_home -v 17) mvn -pl sentinel-extension/sentinel-parameter-flow-control -am -Dtest=ModifyParamFlowRulesCommandHandlerTest -Dsurefire.failIfNoSpecifiedTests=false test
JAVA_HOME=$(/usr/libexec/java_home -v 17) mvn -pl sentinel-extension/sentinel-parameter-flow-control -am -Dsurefire.failIfNoSpecifiedTests=false test

@CLAassistant

CLAassistant commented Jun 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@hutiefang76 hutiefang76 force-pushed the codex/sentinel-3505-param-plus branch from cc5a35d to 69614d6 Compare June 27, 2026 02:44
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.

[BUG] 热点参数限流,key的值配置了包含字符"+"的时候,会把“+”变成“ ”,修改了原本的意思

2 participants