Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'workhorse/internal/upload/uploads.go')
-rw-r--r--workhorse/internal/upload/uploads.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/workhorse/internal/upload/uploads.go b/workhorse/internal/upload/uploads.go
index 61b419901a7..f214e1ac297 100644
--- a/workhorse/internal/upload/uploads.go
+++ b/workhorse/internal/upload/uploads.go
@@ -3,6 +3,7 @@ package upload
import (
"bytes"
"context"
+ "errors"
"fmt"
"io"
"mime/multipart"
@@ -63,7 +64,11 @@ func interceptMultipartFiles(w http.ResponseWriter, r *http.Request, h http.Hand
case exif.ErrRemovingExif:
helper.CaptureAndFail(w, r, err, "Failed to process image", http.StatusUnprocessableEntity)
default:
- helper.Fail500(w, r, fmt.Errorf("handleFileUploads: extract files from multipart: %v", err))
+ if errors.Is(err, context.DeadlineExceeded) {
+ helper.CaptureAndFail(w, r, err, "deadline exceeded", http.StatusGatewayTimeout)
+ } else {
+ helper.Fail500(w, r, fmt.Errorf("handleFileUploads: extract files from multipart: %v", err))
+ }
}
return
}