Skip to content

Commit 55f3ecc

Browse files
authored
Merge pull request #6 from ImageMarkup/remove-basic-auth
2 parents 528b83d + 048e5ef commit 55f3ecc

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

main.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ func main() {
1616
zipServer := zip_streamer.NewServer()
1717
zipServer.Compression = (os.Getenv("ZS_COMPRESSION") == "DEFLATE")
1818
zipServer.ListfileUrlPrefix = os.Getenv("ZS_LISTFILE_URL_PREFIX")
19-
zipServer.ListfileBasicAuth = os.Getenv("ZS_LISTFILE_BASIC_AUTH")
20-
21-
if zipServer.ListfileBasicAuth == "" {
22-
log.Fatalf("ZS_LISTFILE_BASIC_AUTH must be set")
23-
}
2419

2520
port := os.Getenv("PORT")
2621
if port == "" {

zip_streamer/server.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ type Server struct {
2020
linkCache LinkCache
2121
Compression bool
2222
ListfileUrlPrefix string
23-
ListfileBasicAuth string
2423
}
2524

2625
func NewServer() *Server {
@@ -116,7 +115,7 @@ func (s *Server) HandleGetDownload(w http.ResponseWriter, req *http.Request) {
116115
return
117116
}
118117

119-
zipDescriptor, err := retrieveZipDescriptorFromUrl(listfileUrl, s.ListfileBasicAuth)
118+
zipDescriptor, err := retrieveZipDescriptorFromUrl(listfileUrl)
120119
if err != nil {
121120
w.WriteHeader(http.StatusNotFound)
122121
w.Write([]byte(`{"status":"error","error":"file not found"}`))
@@ -126,12 +125,11 @@ func (s *Server) HandleGetDownload(w http.ResponseWriter, req *http.Request) {
126125
s.streamEntries(zipDescriptor, w, req)
127126
}
128127

129-
func retrieveZipDescriptorFromUrl(listfileUrl string, listfileBasicAuth string) (*ZipDescriptor, error) {
128+
func retrieveZipDescriptorFromUrl(listfileUrl string) (*ZipDescriptor, error) {
130129
req, err := http.NewRequest("GET", listfileUrl, nil)
131130
if err != nil {
132131
return nil, err
133132
}
134-
req.SetBasicAuth("", listfileBasicAuth)
135133
req.Header.Set("User-Agent", fmt.Sprintf("isic-zipstreamer/%s", getVcsRevision()))
136134
listfileResp, err := http.DefaultClient.Do(req)
137135
if err != nil {

0 commit comments

Comments
 (0)