Increase max size and remove timeout for software installer uploads (#22725)

This commit is contained in:
Sarah Gillespie
2024-10-08 14:27:55 -05:00
committed by GitHub
parent 88fe04ebdf
commit 9c4671a37e
6 changed files with 49 additions and 43 deletions
+3 -3
View File
@@ -49,7 +49,7 @@ type uploadSoftwareInstallerResponse struct {
// MaxSoftwareInstallerSize is the maximum size allowed for software
// installers. This is enforced by the endpoints that upload installers.
const MaxSoftwareInstallerSize = 500 * units.MiB
const MaxSoftwareInstallerSize = 3000 * units.MiB
// TODO: We parse the whole body before running svc.authz.Authorize.
// An authenticated but unauthorized user could abuse this.
@@ -68,7 +68,7 @@ func (updateSoftwareInstallerRequest) DecodeRequest(ctx context.Context, r *http
var mbe *http.MaxBytesError
if errors.As(err, &mbe) {
return nil, &fleet.BadRequestError{
Message: "The maximum file size is 500 MB.",
Message: "The maximum file size is 3 GB.",
InternalErr: err,
}
}
@@ -91,7 +91,7 @@ func (updateSoftwareInstallerRequest) DecodeRequest(ctx context.Context, r *http
if decoded.File.Size > MaxSoftwareInstallerSize {
// Should never happen here since the request's body is limited to the maximum size.
return nil, &fleet.BadRequestError{
Message: "The maximum file size is 500 MB.",
Message: "The maximum file size is 3 GB.",
}
}
}