mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[PR #22116] [CLOSED] fix(tools): normalize tool server URLs to prevent double-slash issues #42129
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22116
Author: @eren-karakus0
Created: 3/1/2026
Status: ❌ Closed
Base:
dev← Head:fix/tool-server-url-path📝 Commits (1)
d71e329fix(tools): normalize tool server URLs to prevent double-slash issues📊 Changes
2 files changed (+75 additions, -2 deletions)
View changed files
➕
backend/open_webui/test/util/test_tools.py(+71 -0)📝
backend/open_webui/utils/tools.py(+4 -2)📄 Description
Pull Request Checklist
devbranch.dev.fix:Changelog Entry
Description
Fixes #21917
When a tool server URL includes a trailing slash (e.g.
http://host:8080/v1/), joining it with a path like/openapi.jsonor a route like/searchproduces a double-slash URL (http://host:8080/v1//openapi.json). Some servers reject or misroute these malformed URLs, causing connection failures.Fixed
get_tool_server_url- spec URL construction (verify flow)get_tool_servers_data- stored URL normalizationexecute_tool_server- execution URL constructionNoneguard on stored URL to preventAttributeErroron malformed configsAdded
get_tool_server_urlcovering trailing slashes, subpaths, proxy prefixes, and edge cases (backend/open_webui/test/util/test_tools.py)Additional Information
backend/open_webui/utils/tools.pymodified (4 additions, 2 deletions)Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.