Skip to content

Commit

Permalink
Fix page download issues
Browse files Browse the repository at this point in the history
closes #16
  • Loading branch information
elboletaire committed Jan 20, 2023
1 parent ab1a1d1 commit 0c65940
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions downloader/fetch.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package downloader

import (
"bytes"
"io"
"sort"
"sync"
Expand Down Expand Up @@ -64,14 +63,15 @@ func FetchFile(params http.RequestParams, page uint) (file *File, err error) {
return
}

data := new(bytes.Buffer)
io.Copy(data, body)
defer body.Close()

data, err := io.ReadAll(body)
if err != nil {
return
}

file = &File{
Data: data.Bytes(),
Data: data,
Page: page,
}

Expand Down

0 comments on commit 0c65940

Please sign in to comment.