Storage: use static access rules (#52334)
* Storage: use static access rules * Storage: use static access rules * Storage: add tests
This commit is contained in:
@@ -37,7 +37,7 @@ func ProvideHTTPService(store StorageService) HTTPStorageService {
|
||||
|
||||
func UploadErrorToStatusCode(err error) int {
|
||||
switch {
|
||||
case errors.Is(err, ErrUploadFeatureDisabled):
|
||||
case errors.Is(err, ErrStorageNotFound):
|
||||
return 404
|
||||
|
||||
case errors.Is(err, ErrUnsupportedStorage):
|
||||
@@ -49,6 +49,9 @@ func UploadErrorToStatusCode(err error) int {
|
||||
case errors.Is(err, ErrFileAlreadyExists):
|
||||
return 400
|
||||
|
||||
case errors.Is(err, ErrAccessDenied):
|
||||
return 403
|
||||
|
||||
default:
|
||||
return 500
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user