mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-08 22:22:17 +02:00
fix(mcp): omit unset query params from REST requests
This commit is contained in:
parent
cb22cc4bfc
commit
abbb43632f
1 changed files with 4 additions and 0 deletions
|
|
@ -49,6 +49,10 @@ class SurfSenseClient:
|
|||
files: Any | None = None,
|
||||
) -> Any:
|
||||
"""Send a request and return the parsed body, or raise ``ToolError``."""
|
||||
# Omit unset query params: sending them empty makes the API parse ""
|
||||
# as a value (e.g. int("") on folder_id) and fail.
|
||||
if params is not None:
|
||||
params = {key: value for key, value in params.items() if value is not None}
|
||||
try:
|
||||
response = await self._http.request(
|
||||
method, path, params=params, json=json, data=data, files=files
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue