Skip to content

Commit

Permalink
handlers: add headers as queryparam for pull sources
Browse files Browse the repository at this point in the history
  • Loading branch information
emranemran committed Feb 1, 2024
1 parent 316bac6 commit 7ffcd02
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion handlers/geolocation/geolocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,17 @@ func (c *GeolocationHandlersCollection) getStreamPull(playbackID string) (string
return "", nil
}

return stream.Pull.Source, nil
if len(stream.Pull.Headers) == 0 {
return stream.Pull.Source, nil
}

var params []string
for k, v := range stream.Pull.Headers {
param := "addheader=" + url.QueryEscape(k+":"+v)
params = append(params, param)
}
finalPullURL := stream.Pull.Source + "?" + strings.Join(params, "&")
return finalPullURL, nil
}

func parsePlus(plusString string) (string, string) {
Expand Down

0 comments on commit 7ffcd02

Please sign in to comment.