mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 14:04:18 +02:00
Guard against query params clobbering path params
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c3948368e8
commit
0cc6505b01
1 changed files with 4 additions and 1 deletions
|
|
@ -110,7 +110,10 @@ def match_uri_template(uri: str, uri_template: str) -> dict[str, str] | None:
|
|||
if name in parsed_query:
|
||||
# Take first value if multiple provided.
|
||||
# Normalize hyphens to underscores to match Python param names.
|
||||
params[name.replace("-", "_")] = parsed_query[name][0]
|
||||
# Don't overwrite path params that were already extracted.
|
||||
key = name.replace("-", "_")
|
||||
if key not in params:
|
||||
params[key] = parsed_query[name][0]
|
||||
|
||||
return params
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue