Merge pull request #7772 from 2403905/issue-7744

fix the tgz mime type, bump reva
This commit is contained in:
Roman Perekhod
2023-11-21 18:08:28 +01:00
committed by GitHub
9 changed files with 23 additions and 7 deletions

View File

@@ -0,0 +1,6 @@
Bugfix: Fix the tgz mime type
We have fixed a bug when the tgz mime type was not "application/gzip"
https://github.com/owncloud/ocis/pull/7772
https://github.com/owncloud/ocis/issues/7744

2
go.mod
View File

@@ -13,7 +13,7 @@ require (
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/coreos/go-oidc/v3 v3.7.0
github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781
github.com/cs3org/reva/v2 v2.16.1-0.20231118225258-99a29662fcb4
github.com/cs3org/reva/v2 v2.16.1-0.20231121150727-6f872b2efd27
github.com/dhowden/tag v0.0.0-20230630033851-978a0926ee25
github.com/disintegration/imaging v1.6.2
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e

4
go.sum
View File

@@ -1013,8 +1013,8 @@ github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c=
github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME=
github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781 h1:BUdwkIlf8IS2FasrrPg8gGPHQPOrQ18MS1Oew2tmGtY=
github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/cs3org/reva/v2 v2.16.1-0.20231118225258-99a29662fcb4 h1:SyqrF8Q60IJtGsU4tt0pFdkwKWGE3qoKADc4KNS3Fe0=
github.com/cs3org/reva/v2 v2.16.1-0.20231118225258-99a29662fcb4/go.mod h1:utPCNSrWDdAwz2biLrKvzO6nDH9L7vRVGNzof13r8Kw=
github.com/cs3org/reva/v2 v2.16.1-0.20231121150727-6f872b2efd27 h1:eIwU0jW2qIwQHaAbV65ekUnJ5dwQhaIPdoX6tPKfKGA=
github.com/cs3org/reva/v2 v2.16.1-0.20231121150727-6f872b2efd27/go.mod h1:utPCNSrWDdAwz2biLrKvzO6nDH9L7vRVGNzof13r8Kw=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=

View File

@@ -303,7 +303,7 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string
"enabled": false,
},
"mediatype": map[string]interface{}{
"keywords": []string{"file", "folder", "document", "spreadsheet", "presentation", "pdf", "image", "video", "audio", "archive"},
"keywords": []string{"document", "spreadsheet", "presentation", "pdf", "image", "video", "audio", "folder", "archive"},
"enabled": true,
},
"type": map[string]interface{}{

File diff suppressed because one or more lines are too long

View File

@@ -329,10 +329,11 @@ func mimeType(k, v string) (bleveQuery.Query, bool) {
case "archive":
return bleveQuery.NewDisjunctionQuery(newQueryStringQueryList(k,
"application/zip",
"application/x-tar",
"application/gzip",
"application/x-gzip",
"application/x-7z-compressed",
"application/x-rar-compressed",
"application/x-tar",
"application/x-bzip2",
"application/x-bzip",
"application/x-tgz",

View File

@@ -135,8 +135,15 @@ func (m *manager) Authenticate(ctx context.Context, token, secret string) (*user
getUserResponse, err := gwConn.GetUser(ctx, &userprovider.GetUserRequest{
UserId: publicShareResponse.GetShare().GetCreator(),
})
if err != nil {
switch {
case err != nil:
return nil, nil, err
case getUserResponse.GetStatus().GetCode() == rpcv1beta1.Code_CODE_NOT_FOUND:
return nil, nil, errtypes.NotFound(getUserResponse.GetStatus().GetMessage())
case getUserResponse.GetStatus().GetCode() == rpcv1beta1.Code_CODE_PERMISSION_DENIED:
return nil, nil, errtypes.InvalidCredentials(getUserResponse.GetStatus().GetMessage())
case getUserResponse.GetStatus().GetCode() != rpcv1beta1.Code_CODE_OK:
return nil, nil, errtypes.InternalError(getUserResponse.GetStatus().GetMessage())
}
owner = getUserResponse.GetUser()
}

View File

@@ -921,6 +921,7 @@ var mimeTypes = map[string]string{
"tfm": "application/x-tex-tfm",
"tfx": "image/tiff-fx",
"tga": "image/x-tga",
"tgz": "application/gzip",
"thmx": "application/vnd.ms-officetheme",
"tif": "image/tiff",
"tiff": "image/tiff",

2
vendor/modules.txt vendored
View File

@@ -357,7 +357,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1
github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1
github.com/cs3org/go-cs3apis/cs3/tx/v1beta1
github.com/cs3org/go-cs3apis/cs3/types/v1beta1
# github.com/cs3org/reva/v2 v2.16.1-0.20231118225258-99a29662fcb4
# github.com/cs3org/reva/v2 v2.16.1-0.20231121150727-6f872b2efd27
## explicit; go 1.20
github.com/cs3org/reva/v2/cmd/revad/internal/grace
github.com/cs3org/reva/v2/cmd/revad/runtime