Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Commit

Permalink
Use Transport with compression disabled to work around wrong headers …
Browse files Browse the repository at this point in the history
…send by RRF for zip files
  • Loading branch information
wilriker committed May 31, 2019
1 parent 6f0d369 commit c48ff7b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion duetbackup.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const (

var offsetString string
var once sync.Once
var httpClient *http.Client

type file struct {
Type string
Expand Down Expand Up @@ -153,7 +154,7 @@ func updateLocalFiles(baseURL string, fl *filelist, outDir string, removeLocal b
}

// Download file
resp, err := http.Get(baseURL + fileDownloadURL + url.QueryEscape(file.Name))
resp, err := httpClient.Get(baseURL + fileDownloadURL + url.QueryEscape(file.Name))
if err != nil {
return err
}
Expand Down Expand Up @@ -262,6 +263,9 @@ func main() {
os.Exit(1)
}

tr := &http.Transport{DisableCompression: true}
httpClient = &http.Client{Transport: tr}

address := getAddress(domain, port)

// Try to connect
Expand Down

0 comments on commit c48ff7b

Please sign in to comment.