Skip to content

Commit

Permalink
fix: rtmp publish key host parse
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Nov 24, 2024
1 parent e7b7969 commit 8039c79
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/handlers/movie.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"image/png"
"math/rand/v2"
"net/http"
"net/url"
"path/filepath"
"slices"
"strings"
Expand Down Expand Up @@ -403,7 +404,13 @@ func NewPublishKey(ctx *gin.Context) {

host := settings.CustomPublishHost.Get()
if host == "" {
host = settings.HOST.Get()
u, err := url.Parse(settings.HOST.Get())
if err != nil {
log.Errorf("new publish key error: %v", err)
ctx.AbortWithStatusJSON(http.StatusInternalServerError, model.NewAPIErrorResp(err))
return
}
host = u.Host
}
if host == "" {
host = ctx.Request.Host
Expand Down

0 comments on commit 8039c79

Please sign in to comment.