Skip to content

添加静态文件 授信host 功能 防止XSS#747

Open
gaoxingzaq wants to merge 3 commits intokekingcn:masterfrom
gaoxingzaq:dle
Open

添加静态文件 授信host 功能 防止XSS#747
gaoxingzaq wants to merge 3 commits intokekingcn:masterfrom
gaoxingzaq:dle

Conversation

@gaoxingzaq
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@klboke klboke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

发现 2 个会直接影响现有预览能力的 blocker:

  1. online3D 现在只把“单个 Blob 文件”喂给 viewer,导致依赖伴随资源的多文件格式回归。原实现是把 website/index.html#model=... 交给内置 hash loader 处理,viewer 自己支持 URL 列表和依赖文件(server/src/main/resources/web/online3D.ftl:22-31server/src/main/resources/static/website/build/website_dev/o3dv.website.min.js:9487-9488, 10198, 10371-10381)。这个 PR 改成了先 fetch 一个 modelUrl,再构造单个 File 触发 <input type=file> 流程(server/src/main/resources/web/online3D.ftl:90-133)。这样像 .obj + .mtl + texture 这类依赖同目录附属文件的预览就没有依赖文件上下文了;仓库自带的 3D viewer 示例本身都把 obj 当成多 URL 场景处理(server/src/main/resources/static/website/index.html 里的 #model=assets/models/solids.obj,assets/models/solids.mtl)。也就是说,这个改动会把现有一类 3D 预览直接打坏。

  2. drawio 的编辑/新窗口路径现在会打开错误的文件来源。drawio.ftl 仍然显式传了 edit=_blank,所以预览页工具栏上的 edit/open 路径还在(server/src/main/resources/web/drawio.ftl:47-61)。但这个 PR 把 vendor bundle 里的 Editor.prototype.editAsNew 改成了固定写入 file=<currentDomain>,而不是当前图文件 URL(server/src/main/resources/static/drawio/js/app.min.js:2467-2468)。同一个 bundle 里 chromeless toolbar 的 edit 按钮会直接走 editAsNew(...)server/src/main/resources/static/drawio/js/app.min.js:2578-2581)。结果就是用户从预览页点“编辑/新窗口”时,draw.io 会重新对着站点根域名打开,而不是当前 diagram 文件,这条现有交互会失效。

这两个问题都属于合并前需要先修掉的回归。

@gaoxingzaq
Copy link
Copy Markdown
Contributor Author

gaoxingzaq commented Apr 16, 2026

发现 2 个会直接影响现有预览能力的 blocker:

  1. online3D 修复多资源附件问题 添加了附件调用方法https://3dviewer.net/assets/models/solids.mtl,https://3dviewer.net/assets/models/solids.obj
  1. drawio 修复drawio文件 编辑模式edit 获取file路径错误问题

已经修复了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants