Remove unnecessary passing of cache by ref
This commit is contained in:
@@ -14,7 +14,6 @@ import (
|
||||
intHttp "github.com/debridmediamanager.com/zurg/internal/http"
|
||||
intTor "github.com/debridmediamanager.com/zurg/internal/torrent"
|
||||
zurghttp "github.com/debridmediamanager.com/zurg/pkg/http"
|
||||
"github.com/dgraph-io/ristretto"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -27,7 +26,7 @@ func NewGetFile(client *zurghttp.HTTPClient) *GetFile {
|
||||
}
|
||||
|
||||
// HandleGetRequest handles a GET request universally for both WebDAV and HTTP
|
||||
func (gf *GetFile) HandleGetRequest(w http.ResponseWriter, r *http.Request, t *intTor.TorrentManager, c config.ConfigInterface, cache *ristretto.Cache, log *zap.SugaredLogger) {
|
||||
func (gf *GetFile) HandleGetRequest(w http.ResponseWriter, r *http.Request, t *intTor.TorrentManager, c config.ConfigInterface, log *zap.SugaredLogger) {
|
||||
requestPath := path.Clean(r.URL.Path)
|
||||
isDav := true
|
||||
if strings.Contains(requestPath, "/http") {
|
||||
@@ -41,9 +40,9 @@ func (gf *GetFile) HandleGetRequest(w http.ResponseWriter, r *http.Request, t *i
|
||||
// If there are less than 3 segments, return an error or adjust as needed
|
||||
if len(segments) <= 3 {
|
||||
if isDav {
|
||||
dav.HandlePropfindRequest(w, r, t, cache, log)
|
||||
dav.HandlePropfindRequest(w, r, t, log)
|
||||
} else {
|
||||
intHttp.HandleDirectoryListing(w, r, t, cache, log)
|
||||
intHttp.HandleDirectoryListing(w, r, t, log)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user