mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
refac/fix: support delete method for openapi tool servers
This commit is contained in:
parent
515e136502
commit
8039cc40f7
2 changed files with 5 additions and 2 deletions
|
|
@ -754,7 +754,7 @@ async def execute_tool_server(
|
|||
) as session:
|
||||
request_method = getattr(session, http_method.lower())
|
||||
|
||||
if http_method in ["post", "put", "patch"]:
|
||||
if http_method in ["post", "put", "patch", "delete"]:
|
||||
async with request_method(
|
||||
final_url,
|
||||
json=body_params,
|
||||
|
|
|
|||
|
|
@ -494,7 +494,10 @@ export const executeToolServer = async (
|
|||
headers
|
||||
};
|
||||
|
||||
if (['post', 'put', 'patch'].includes(httpMethod.toLowerCase()) && operation.requestBody) {
|
||||
if (
|
||||
['post', 'put', 'patch', 'delete'].includes(httpMethod.toLowerCase()) &&
|
||||
operation.requestBody
|
||||
) {
|
||||
requestOptions.body = JSON.stringify(bodyParams);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue