iOS 播放修复:媒体资产接口支持无 cookie 拉流(会话 ID 即凭证)+ 拒绝诊断日志;新增 caddy-djk HTTPS 反代部署文件

This commit is contained in:
yvan
2026-09-18 11:14:56 +08:00
parent b96363d787
commit 67bb1d01c8
7 changed files with 61 additions and 2 deletions
+11
View File
@@ -94,6 +94,17 @@ func (app *UIApp) registerPlaybackRoutes(mux *http.ServeMux) {
mux.HandleFunc("/api/ui/playback/progress", app.handlePlaybackProgress)
}
// recordPlaybackAssetDenial 记录媒体资产请求被拒的情况,便于诊断
// iOS/WebKit 原生媒体管线的拉流失败(区分会话失效与观看者不匹配)。
func (app *UIApp) recordPlaybackAssetDenial(request *http.Request, reason string) {
agent := request.UserAgent()
if len(agent) > 120 {
agent = agent[:120]
}
app.downloader.recordDiagnostic(diagnosticEvent{Level: "warn", Event: "playback.asset.denied",
HTTPStatus: http.StatusGone, Message: reason + " ua=" + agent})
}
func playbackRequestAllowed(writer http.ResponseWriter, request *http.Request, method string) bool {
writer.Header().Set("Cache-Control", "private, no-store, no-transform")
writer.Header().Set("X-Accel-Buffering", "no")