mirror of
https://github.com/ErlichLiu/DeepClaude.git
synced 2026-04-25 05:05:57 +03:00
[PR #5] [MERGED] 新增跨域配置 #95
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/DeepClaude#95
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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/ErlichLiu/DeepClaude/pull/5
Author: @GowayLee
Created: 2/3/2025
Status: ✅ Merged
Merged: 2/4/2025
Merged by: @ErlichLiu
Base:
main← Head:CORS-config📝 Commits (2)
e272400feat: 新增对使用oneapi接口的claude适配e091419feat: 新增跨域 allow_origins 的配置📊 Changes
4 files changed (+55 additions, -17 deletions)
View changed files
📝
.env.example(+11 -5)📝
app/clients/claude_client.py(+24 -7)📝
app/deepclaude/deepclaude.py(+2 -2)📝
app/main.py(+18 -3)📄 Description
主要更改
在配置文件中增加跨域环境变量的设置, 并在app启动后设置跨域信息.
更改说明
1.
.env.example增加
ALLOW_ORIGINS环境变量, 可以设置多个允许的域名或者使用*设置为允许所有域名.2.
main.py在
fastapi中引入CORSMiddleware, 在app实例化之后, 调用add_middleware方法, 传入由ALLOW_ORIGINS环境变量字符串切片而来的List[str], 完成对跨域允许域名的设置.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.