Skip to content

Commit

Permalink
pass in the urls directly
Browse files Browse the repository at this point in the history
  • Loading branch information
mjh1 committed Oct 13, 2023
1 parent dcbdde9 commit 485d350
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func NewCatalystAPIRouter(cli config.Cli, vodEngine *pipeline.Coordinator, bal b
playback := middleware.LogAndMetrics(metrics.Metrics.PlaybackRequestDurationSec)(
withCORS(
withGatingCheck(
handlers.NewPlaybackHandler(cli).Handle,
handlers.NewPlaybackHandler(cli.PrivateBucketURLs).Handle,
),
),
)
Expand Down
5 changes: 2 additions & 3 deletions handlers/playback.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"net/url"

"github.com/julienschmidt/httprouter"
"github.com/livepeer/catalyst-api/config"
catErrs "github.com/livepeer/catalyst-api/errors"
"github.com/livepeer/catalyst-api/log"
"github.com/livepeer/catalyst-api/playback"
Expand All @@ -19,9 +18,9 @@ type PlaybackHandler struct {
PrivateBucketURLs []*url.URL
}

func NewPlaybackHandler(cli config.Cli) *PlaybackHandler {
func NewPlaybackHandler(urls []*url.URL) *PlaybackHandler {
return &PlaybackHandler{
PrivateBucketURLs: cli.PrivateBucketURLs,
PrivateBucketURLs: urls,
}

Check warning on line 24 in handlers/playback.go

View check run for this annotation

Codecov / codecov/patch

handlers/playback.go#L21-L24

Added lines #L21 - L24 were not covered by tests
}

Expand Down

0 comments on commit 485d350

Please sign in to comment.