Use status code constants
This commit is contained in:
@@ -163,7 +163,7 @@ func (dl *Downloader) streamFileToResponse(
|
||||
defer downloadResp.Body.Close()
|
||||
|
||||
// Check if the download was not successful
|
||||
if downloadResp.StatusCode/100 != 2 {
|
||||
if downloadResp.StatusCode != http.StatusOK && downloadResp.StatusCode != http.StatusPartialContent {
|
||||
log.Warnf("Received a %s status code for file %s", downloadResp.Status, unrestrict.Filename)
|
||||
if file != nil {
|
||||
if err := file.State.Event(context.Background(), "break_file"); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user