Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] API 代理地址末尾被自动补充斜杠 #5651

Open
sxjeru opened this issue Feb 1, 2025 · 2 comments
Open

[Bug] API 代理地址末尾被自动补充斜杠 #5651

sxjeru opened this issue Feb 1, 2025 · 2 comments
Labels
🐛 Bug Something isn't working | 缺陷

Comments

@sxjeru
Copy link
Contributor

sxjeru commented Feb 1, 2025

📦 部署环境

Vercel

📌 软件版本

latest

💻 系统环境

Windows

🌐 浏览器

Chrome

🐛 问题描述

现有一模型终结点为 https://xxx.com/chat/completions,理论上在设置时应当填入 https://xxx.com,内部补充 /chat/completions

然而目前测试当填入 https://xxx.com 后会自动在后面补上斜杠,导致最终访问的模型终结点为 https://xxx.com//chat/completions

📷 复现步骤

No response

🚦 期望结果

No response

📝 补充信息

自定义模型提供商时偶然发现,填入的内容没有末尾斜杠。

Image

@sxjeru sxjeru added the 🐛 Bug Something isn't working | 缺陷 label Feb 1, 2025
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Feb 1, 2025
@lobehubbot
Copy link
Member

👀 @sxjeru

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

Copy link

dosubot bot commented Feb 1, 2025

The issue you're encountering is related to the automatic appending of a trailing slash to the API endpoint URL, which results in a double slash when combined with the path. This behavior is likely due to the URL handling logic in the codebase.

The function responsible for appending a trailing slash is the fillUrl function, which constructs URLs and ensures they end with a slash [1]. This function might be causing the double slash issue when the base URL already ends with a slash or when the path is appended separately.

To resolve this, you might need to adjust the URL handling logic to check for an existing trailing slash before appending another one. This can be done by modifying the fillUrl function or wherever the URL is being constructed to ensure it doesn't add an extra slash if one is already present.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷
Projects
Status: Roadmap - Chat 1.x
Development

No branches or pull requests

2 participants