Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 committed Jul 29, 2024
1 parent 3358451 commit 0cc3877
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/config/urls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ func TestValidateUrl(t *testing.T) {
var twitchUpdated = regexp.MustCompile("rtmps://(.*).contribute.live-video.net/app/streamkey")
var twitchRedacted = regexp.MustCompile("rtmps://(.*).contribute.live-video.net/app/\\{str\\.\\.\\.key}")

o := &StreamConfig{}

for _, test := range []struct {
url string
twitch bool
Expand Down Expand Up @@ -58,7 +60,7 @@ func TestValidateUrl(t *testing.T) {
redacted: "rtmps://localhost:1935/live/{str...key}",
},
} {
updated, redacted, err := ValidateUrl(test.url, types.OutputTypeRTMP)
updated, redacted, err := o.ValidateUrl(test.url, types.OutputTypeRTMP)
require.NoError(t, err)

if test.twitch {
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipeline/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (c *Controller) UpdateStream(ctx context.Context, req *livekit.UpdateStream
// add stream outputs first
for _, rawUrl := range req.AddOutputUrls {
// validate and redact url
url, redacted, err := config.ValidateUrl(rawUrl, o.OutputType)
url, redacted, err := o.ValidateUrl(rawUrl, o.OutputType)
if err != nil {
errs.AppendErr(err)
continue
Expand Down

0 comments on commit 0cc3877

Please sign in to comment.