refactor: split playback proxy logic into separate handler files

This commit is contained in:
2026-06-16 00:53:52 +02:00
committed by Milas Holsting
parent 9e25745804
commit 2a04876754
7 changed files with 306 additions and 257 deletions

View File

@@ -0,0 +1,23 @@
package handler
import (
"net/http"
"github.com/gin-gonic/gin"
)
func (h *PlaybackHandler) resolveProxyRequestTarget(c *gin.Context, scope string) (string, string, bool) {
token := c.Query("token")
if token == "" {
c.Status(http.StatusBadRequest)
return "", "", false
}
targetURL, referer, err := h.svc.ResolveProxyToken(token, scope)
if err != nil {
c.Status(http.StatusForbidden)
return "", "", false
}
return targetURL, referer, true
}