Proper caching

This commit is contained in:
Ben Sarmiento
2023-10-18 12:36:34 +02:00
parent bd72dc4540
commit acee02377e
9 changed files with 126 additions and 65 deletions

View File

@@ -4,7 +4,6 @@ import (
"log"
"net/http"
"os"
"path"
"github.com/debridmediamanager.com/zurg/internal/torrent"
)
@@ -14,9 +13,8 @@ func Router(mux *http.ServeMux) {
t := torrent.NewTorrentManager(os.Getenv("RD_TOKEN"))
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
requestPath := path.Clean(r.URL.Path)
log.Println(r.Method, requestPath)
// requestPath := path.Clean(r.URL.Path)
// log.Println(r.Method, requestPath)
switch r.Method {
case "PROPFIND":
@@ -24,6 +22,7 @@ func Router(mux *http.ServeMux) {
case http.MethodGet:
HandleGetRequest(w, r, t)
// default return
case http.MethodOptions:
w.WriteHeader(http.StatusOK)