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

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


hutiefang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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