Skip to content

Comments

WW-5535 Fix HttpMethodInterceptor with wildcard action names#1592

Open
lukaszlenart wants to merge 1 commit intomainfrom
fix/WW-5535-http-method-interceptor-wildcard
Open

WW-5535 Fix HttpMethodInterceptor with wildcard action names#1592
lukaszlenart wants to merge 1 commit intomainfrom
fix/WW-5535-http-method-interceptor-wildcard

Conversation

@lukaszlenart
Copy link
Member

Summary

  • Fix DefaultActionProxy.resolveMethod() to only set methodSpecified=false when defaulting to "execute", not when the method is resolved from ActionConfig (including wildcard substitutions like method="{1}")
  • Update ActionProxy.isMethodSpecified() Javadoc to reflect corrected semantics
  • Add unit tests for isMethodSpecified() covering explicit, config-resolved, wildcard, and default cases

Fixes WW-5535

Problem

For wildcard actions like <action name="example-*" method="do{1}">, DefaultActionProxy.resolveMethod() unconditionally set methodSpecified = false when the method wasn't passed explicitly from the URL. This included methods resolved from ActionConfig after wildcard substitution. As a result, HttpMethodInterceptor would skip method-level @HttpPost/@HttpGet annotation checks and fall back to class-level annotations — undermining security validation.

Fix

Moved methodSpecified = false inside the inner if block that defaults to "execute", so it only triggers for the true default case. Methods resolved from config (including wildcard-substituted values) now correctly report isMethodSpecified() == true.

Test plan

  • DefaultActionProxyTest — 4 new tests for isMethodSpecified() semantics (explicit, config, wildcard, default)
  • HttpMethodInterceptorTest — 3 new tests verifying method-level annotation checks with wildcard-resolved methods
  • All existing tests pass unchanged

🤖 Generated with Claude Code

@lukaszlenart lukaszlenart force-pushed the fix/WW-5535-http-method-interceptor-wildcard branch from e6ad295 to 803be76 Compare February 22, 2026 16:06
DefaultActionProxy.resolveMethod() unconditionally set methodSpecified=false
when the method was not passed explicitly, including when it was resolved from
ActionConfig (e.g., wildcard substitution like method="{1}"). This caused
HttpMethodInterceptor to skip method-level annotation checks for wildcard
actions, falling back to class-level annotations instead.

Move methodSpecified=false inside the inner branch that defaults to "execute",
so config-resolved methods (including wildcard-substituted ones) correctly
report isMethodSpecified()=true. Update Javadoc to reflect the corrected
semantics.

Fixes [WW-5535](https://issues.apache.org/jira/browse/WW-5535)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@lukaszlenart lukaszlenart force-pushed the fix/WW-5535-http-method-interceptor-wildcard branch from 803be76 to fbcb374 Compare February 22, 2026 16:17
@sonarqubecloud
Copy link

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.

1 participant