MM-17607: large [brand, team, profile] images crash the server (#11827)
Этот коммит содержится в:
@@ -39,7 +39,7 @@ func (a *App) SaveBrandImage(imageData *multipart.FileHeader) *model.AppError {
|
||||
}
|
||||
|
||||
if config.Width*config.Height > model.MaxImageSize {
|
||||
return model.NewAppError("SaveBrandImage", "brand.save_brand_image.too_large.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||
return model.NewAppError("SaveBrandImage", "brand.save_brand_image.too_large.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
file.Seek(0, 0)
|
||||
|
||||
@@ -1361,7 +1361,7 @@ func (a *App) SetTeamIconFromMultiPartFile(teamId string, file multipart.File) *
|
||||
return model.NewAppError("SetTeamIcon", "api.team.set_team_icon.decode_config.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||
}
|
||||
if config.Width*config.Height > model.MaxImageSize {
|
||||
return model.NewAppError("SetTeamIcon", "api.team.set_team_icon.too_large.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||
return model.NewAppError("SetTeamIcon", "api.team.set_team_icon.too_large.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
file.Seek(0, 0)
|
||||
|
||||
@@ -867,7 +867,7 @@ func (a *App) SetProfileImageFromMultiPartFile(userId string, file multipart.Fil
|
||||
return model.NewAppError("SetProfileImage", "api.user.upload_profile_user.decode_config.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||
}
|
||||
if config.Width*config.Height > model.MaxImageSize {
|
||||
return model.NewAppError("SetProfileImage", "api.user.upload_profile_user.too_large.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||
return model.NewAppError("SetProfileImage", "api.user.upload_profile_user.too_large.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
file.Seek(0, 0)
|
||||
|
||||
Ссылка в новой задаче
Block a user