Use the chunk manager properly
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
"github.com/debridmediamanager.com/zurg/internal/config"
|
||||
"github.com/debridmediamanager.com/zurg/internal/dav"
|
||||
intHttp "github.com/debridmediamanager.com/zurg/internal/http"
|
||||
zurghttp "github.com/debridmediamanager.com/zurg/internal/http"
|
||||
"github.com/debridmediamanager.com/zurg/internal/torrent"
|
||||
"github.com/debridmediamanager.com/zurg/internal/universal"
|
||||
"github.com/debridmediamanager.com/zurg/pkg/logutil"
|
||||
@@ -25,11 +25,11 @@ func Router(mux *http.ServeMux, c config.ConfigInterface, t *torrent.TorrentMana
|
||||
if countNonEmptySegments(strings.Split(requestPath, "/")) > 3 {
|
||||
universal.HandleGetRequest(w, r, t, c, cache)
|
||||
} else {
|
||||
intHttp.HandleDirectoryListing(w, r, t, c)
|
||||
zurghttp.HandleDirectoryListing(w, r, t, c)
|
||||
}
|
||||
|
||||
case http.MethodHead:
|
||||
universal.HandleHeadRequest(w, r, t, c, cache)
|
||||
universal.HandleHeadRequest(w, r, t, cache)
|
||||
|
||||
default:
|
||||
log.Errorf("Request %s %s not supported yet", r.Method, r.URL.Path)
|
||||
|
||||
@@ -7,13 +7,12 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/debridmediamanager.com/zurg/internal/config"
|
||||
"github.com/debridmediamanager.com/zurg/internal/torrent"
|
||||
"github.com/debridmediamanager.com/zurg/pkg/logutil"
|
||||
"github.com/hashicorp/golang-lru/v2/expirable"
|
||||
)
|
||||
|
||||
func HandleHeadRequest(w http.ResponseWriter, r *http.Request, t *torrent.TorrentManager, c config.ConfigInterface, cache *expirable.LRU[string, string]) {
|
||||
func HandleHeadRequest(w http.ResponseWriter, r *http.Request, t *torrent.TorrentManager, cache *expirable.LRU[string, string]) {
|
||||
log := logutil.NewLogger().Named("unihead")
|
||||
|
||||
requestPath := path.Clean(r.URL.Path)
|
||||
|
||||
Reference in New Issue
Block a user