-
Notifications
You must be signed in to change notification settings - Fork 11.3k
feat: 元点流商 OriginFlow 二次开发 + 与 originflow 统一 web/src 前端 #6690
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
Closed
Closed
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
cac1edc
feat(originflow): 营销站 + 品牌替换 + 公开API + www/app/api 部署隔离
5d80872
feat(originflow): P1 商业化增强 — QuickStart/Usage/SEO/销售线索后台/埋点/邮件通知
d823098
fix(build): 修复 web/classic 因 date-fns v4 与 date-fns-tz v1 不兼容导致的构建失败
1ef77f3
feat(originflow): 模型商店 Model Market 后端 — 商品表/管理员CRUD/公开读取/多语言与货币
4f3fee0
feat(originflow): 模型商店 Model Market 前端管理后台 — 列表/新建/编辑/删除 + 侧边栏入口
ee031c0
feat(originflow): 模型市场公开门店页 /market
c6f2c0a
fix(originflow): ContactForm Select onValueChange 允许 null 导致类型错误
2785c08
fix(originflow): __root.tsx ensureHostIsolation 类型错误
625ab45
feat(p2): 企业团队空间 / SLA 状态页 / 区域路由(含选渠道逻辑)/ 分销商控制台 (#2)
peidunyue 9ab7633
feat: Model Market — admin CRUD + public read API + storefront (#1)
peidunyue 3319927
feat(p2): P2 前端管理页面(团队空间/区域路由/SLA/分销商)+ 团队详情路由 (#3)
peidunyue b08ccc7
feat(teams): add team projects tab to team detail (#4)
peidunyue 7124099
build: 改为从本仓库源码构建并加固 bun 安装可靠性
000421b
branding: 统一为元点流商 OriginFlow(默认前端)
333c958
feat(mvp): 营销站前端 + 公开接口(域名隔离 host 切换)
3c333be
文案调整:中文 Hero 标题精简为「大模型统一API网关」
ce778ba
feat(mvp): 新增 API Quick Start 开发者接入页(P1-01)
34a52be
merge: integrate originflow and unify web/src on canonical frontend
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package common | ||
|
|
||
| import ( | ||
| "net/url" | ||
| "strings" | ||
| ) | ||
|
|
||
| // IsSafeRedirect 校验重定向目标是否安全,防止开放重定向(Open Redirect)。 | ||
| // 允许:空串(无重定向)、同源相对路径(以 / 开头且非协议相对 //host)、指向已知官方域名。 | ||
| func IsSafeRedirect(u string) bool { | ||
| u = strings.TrimSpace(u) | ||
| if u == "" { | ||
| return true | ||
| } | ||
| // 相对路径,但排除协议相对地址(//evil.com) | ||
| if strings.HasPrefix(u, "/") { | ||
| return !strings.HasPrefix(u, "//") | ||
| } | ||
| parsed, err := url.Parse(u) | ||
| if err != nil { | ||
| return false | ||
| } | ||
| if parsed.Scheme != "http" && parsed.Scheme != "https" { | ||
| return false | ||
| } | ||
| host := parsed.Host | ||
| return host == "91flow.com" || strings.HasSuffix(host, ".91flow.com") | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🔴 Critical | ⚡ Quick win
Reject backslash-based protocol-relative paths.
Line 16 accepts
/\evil.examplebecause it starts with/but not//. Browser URL parsing treats backslashes as path separators for special URLs. The destination can become//evil.exampleand bypass the origin restriction.Normalize backslashes before the protocol-relative URL check.
Proposed fix
if strings.HasPrefix(u, "/") { - return !strings.HasPrefix(u, "//") + return !strings.HasPrefix(strings.ReplaceAll(u, "\\", "/"), "//") }📝 Committable suggestion
🤖 Prompt for AI Agents