[PR #5] [MERGED] 新增跨域配置 #95

Closed
opened 2026-02-27 01:56:12 +03:00 by kerem · 0 comments
Owner

📋 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: mainHead: CORS-config


📝 Commits (2)

  • e272400 feat: 新增对使用oneapi接口的claude适配
  • e091419 feat: 新增跨域 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.

## 📋 Pull Request Information **Original PR:** https://github.com/ErlichLiu/DeepClaude/pull/5 **Author:** [@GowayLee](https://github.com/GowayLee) **Created:** 2/3/2025 **Status:** ✅ Merged **Merged:** 2/4/2025 **Merged by:** [@ErlichLiu](https://github.com/ErlichLiu) **Base:** `main` ← **Head:** `CORS-config` --- ### 📝 Commits (2) - [`e272400`](https://github.com/ErlichLiu/DeepClaude/commit/e272400c716deea3e8d5ff33219d8f86fc1f4b4e) feat: 新增对使用oneapi接口的claude适配 - [`e091419`](https://github.com/ErlichLiu/DeepClaude/commit/e091419f0ad9ac31ebb4ef971370c11aa334598f) feat: 新增跨域 allow_origins 的配置 ### 📊 Changes **4 files changed** (+55 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+11 -5) 📝 `app/clients/claude_client.py` (+24 -7) 📝 `app/deepclaude/deepclaude.py` (+2 -2) 📝 `app/main.py` (+18 -3) </details> ### 📄 Description ## 主要更改 在配置文件中增加跨域环境变量的设置, 并在app启动后设置跨域信息. ## 更改说明 ### 1. `.env.example` 增加`ALLOW_ORIGINS`环境变量, 可以设置多个允许的域名或者使用`*`设置为允许所有域名. ### 2. `main.py` 在`fastapi`中引入`CORSMiddleware`, 在`app`实例化之后, 调用`add_middleware`方法, 传入由`ALLOW_ORIGINS`环境变量字符串切片而来的`List[str]`, 完成对跨域允许域名的设置. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 01:56:12 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/DeepClaude#95
No description provided.