From 048e5ef3bb2f64dad5f6b8f4f1d06959f6b6bc63 Mon Sep 17 00:00:00 2001 From: Dan LaManna Date: Tue, 2 Sep 2025 14:33:42 -0400 Subject: [PATCH] Drop basic auth support for descriptor upstreams --- main.go | 5 ----- zip_streamer/server.go | 6 ++---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index bdefcb4..e759a17 100644 --- a/main.go +++ b/main.go @@ -16,11 +16,6 @@ func main() { zipServer := zip_streamer.NewServer() zipServer.Compression = (os.Getenv("ZS_COMPRESSION") == "DEFLATE") zipServer.ListfileUrlPrefix = os.Getenv("ZS_LISTFILE_URL_PREFIX") - zipServer.ListfileBasicAuth = os.Getenv("ZS_LISTFILE_BASIC_AUTH") - - if zipServer.ListfileBasicAuth == "" { - log.Fatalf("ZS_LISTFILE_BASIC_AUTH must be set") - } port := os.Getenv("PORT") if port == "" { diff --git a/zip_streamer/server.go b/zip_streamer/server.go index df8cf31..91ca02b 100644 --- a/zip_streamer/server.go +++ b/zip_streamer/server.go @@ -20,7 +20,6 @@ type Server struct { linkCache LinkCache Compression bool ListfileUrlPrefix string - ListfileBasicAuth string } func NewServer() *Server { @@ -116,7 +115,7 @@ func (s *Server) HandleGetDownload(w http.ResponseWriter, req *http.Request) { return } - zipDescriptor, err := retrieveZipDescriptorFromUrl(listfileUrl, s.ListfileBasicAuth) + zipDescriptor, err := retrieveZipDescriptorFromUrl(listfileUrl) if err != nil { w.WriteHeader(http.StatusNotFound) w.Write([]byte(`{"status":"error","error":"file not found"}`)) @@ -126,12 +125,11 @@ func (s *Server) HandleGetDownload(w http.ResponseWriter, req *http.Request) { s.streamEntries(zipDescriptor, w, req) } -func retrieveZipDescriptorFromUrl(listfileUrl string, listfileBasicAuth string) (*ZipDescriptor, error) { +func retrieveZipDescriptorFromUrl(listfileUrl string) (*ZipDescriptor, error) { req, err := http.NewRequest("GET", listfileUrl, nil) if err != nil { return nil, err } - req.SetBasicAuth("", listfileBasicAuth) req.Header.Set("User-Agent", fmt.Sprintf("isic-zipstreamer/%s", getVcsRevision())) listfileResp, err := http.DefaultClient.Do(req) if err != nil {