release: v1.2.2 — 双域名配置与 Host 隔离修复
GitHub Release / release (push) Canceled after 0s
Publish Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Canceled after 0s
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Canceled after 0s
Publish Docker image / merge (push) Canceled after 0s
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
GitHub Release / release (push) Canceled after 0s
Publish Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Canceled after 0s
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Canceled after 0s
Publish Docker image / merge (push) Canceled after 0s
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
修复设置页误清空管理域、配置与生效 URL 混淆及第三 Host 绕过隔离;加固 Settings API 与中间件,并更新文档站。
This commit is contained in:
1 parent
6c6766221b
commit
c9c34515dd
36 files changed
+2578
-180
No files matched your search
@@ -8,6 +8,7 @@ import {
|
||||
} from './env'
|
||||
import { findImageKeyByDatePath, findImageKeyByFilename } from './image-index'
|
||||
import { validateImageKey } from './image-key'
|
||||
import { toStorageKeyFromPublicPath } from './image-public-path'
|
||||
import { buildPublicImageUrl } from './image-response'
|
||||
import { createImageStream, headImage } from './storage'
|
||||
import { getBackendRowForKey } from './storage/resolver'
|
||||
@@ -80,15 +81,20 @@ export function requestPathToImageKey(
|
||||
options?: { hideFolder?: boolean }
|
||||
): string | null {
|
||||
const raw = decodeURIComponent(pathname).replace(/^\/+/, '')
|
||||
if (!raw) return null
|
||||
|
||||
if (validateImageKey(raw)) return raw
|
||||
|
||||
if (options?.hideFolder) {
|
||||
const byFilename = findImageKeyByFilename(raw)
|
||||
if (byFilename && validateImageKey(byFilename)) return byFilename
|
||||
const fromPublic = toStorageKeyFromPublicPath(raw)
|
||||
if (fromPublic) return fromPublic
|
||||
|
||||
const byDatePath = findImageKeyByDatePath(raw)
|
||||
if (byDatePath && validateImageKey(byDatePath)) return byDatePath
|
||||
}
|
||||
if (!options?.hideFolder) return null
|
||||
|
||||
const byFilename = findImageKeyByFilename(raw)
|
||||
if (byFilename && validateImageKey(byFilename)) return byFilename
|
||||
|
||||
const byDatePath = findImageKeyByDatePath(raw)
|
||||
if (byDatePath && validateImageKey(byDatePath)) return byDatePath
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user