apache / apache/shenyu

[BUG] RequestConfigHelper.getUrlTemplate/getMethod NPE when requestTemplate/url absent

Open
#6,750 2 comments 0 reactions 1 assignee Claimed by @yykaue View on GitHub
feature: plugin priority: medium type: bug
Dominant language
Java
Stars
8.8k
Forks
3.1k
Avg merge
7d 1h
Merged PRs (30d)
85

Description

- severity: Medium
- files: `shenyu-plugin/shenyu-plugin-mcp-server/src/main/java/org/apache/shenyu/plugin/mcp/server/request/RequestConfigHelper.java:81-83,90-93`
- description: `getUrlTemplate()` is `getRequestTemplate().get("url").getAsString()` with no null checks. `getRequestTemplate()` returns null when config lacks `requestTemplate`; `.get("url")` returns null when `url` is absent. Either case NPEs on every tool invocation.
- impact: Tool calls with missing `requestTemplate`/`url` fail with opaque NPE.
- suggested_fix: Null-check and throw descriptive `IllegalArgumentException`.
- confidence: High
- related_existing: none

---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.md)._

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.