downloader: fix internal range check

This commit is contained in:
Matthew Penner
2021-08-02 15:16:38 -06:00
parent 3c54c1f840
commit 2a370a8776
2 changed files with 39 additions and 35 deletions

View File

@@ -254,8 +254,8 @@ func getServerPullingFiles(c *gin.Context) {
func postServerPullRemoteFile(c *gin.Context) {
s := ExtractServer(c)
var data struct {
URL string `binding:"required" json:"url"`
Directory string `binding:"required,omitempty" json:"directory"`
RootPath string `binding:"required,omitempty" json:"root"`
URL string `binding:"required" json:"url"`
}
if err := c.BindJSON(&data); err != nil {
return
@@ -286,11 +286,11 @@ func postServerPullRemoteFile(c *gin.Context) {
}
dl := downloader.New(s, downloader.DownloadRequest{
Directory: data.RootPath,
URL: u,
Directory: data.Directory,
})
// Execute this pull in a seperate thread since it may take a long time to complete.
// Execute this pull in a separate thread since it may take a long time to complete.
go func() {
s.Log().WithField("download_id", dl.Identifier).WithField("url", u.String()).Info("starting pull of remote file to disk")
if err := dl.Execute(); err != nil {