mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-14 23:22:54 +00:00
fix(feign): guard @RequestLine against the constant-valued shape
A constant-valued `@RequestLine(SOME_CONST)` is captured as @value_expr, not @value, so `valueNode` is undefined in that shape and the literal dereference crashed the scan. Skip instead — folding verb+path literals through the constant map is out of scope for this PR. Found in maintainer review of #2980.
This commit is contained in:
parent
284d587ea8
commit
330514f13e
1 changed files with 4 additions and 0 deletions
|
|
@ -614,6 +614,10 @@ function scanRouteAnnotations(tree: Parser.Tree): RouteAnnotationScan {
|
|||
} else if (ann === 'RequestLine') {
|
||||
// Feign packs verb + path in one literal; its only named argument is `value`.
|
||||
if (keyNode && keyNode.text !== 'value') continue;
|
||||
// A constant-valued `@RequestLine` arrives as @value_expr, not @value —
|
||||
// `valueNode` is undefined in that shape. Skip rather than dereference
|
||||
// (constant folding for Feign verb+path literals is out of scope here).
|
||||
if (!valueNode) continue;
|
||||
const raw = unquoteLiteral(valueNode.text);
|
||||
const parsed = raw !== null ? parseRequestLine(raw) : null;
|
||||
if (parsed) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue