diff --git a/changelog/unreleased/app-provider-remove-excess-info.md b/changelog/unreleased/app-provider-remove-excess-info.md new file mode 100644 index 0000000000..d26fbdf94c --- /dev/null +++ b/changelog/unreleased/app-provider-remove-excess-info.md @@ -0,0 +1,10 @@ +Bugfix: Remove excess info from the http list app providers endpoint + +We've removed excess info from the http list app providers endpoint. +The app provider section contained all mime types supported by a certain app provider, +which led to a very big JSON payload and since they are not used they have been removed again. +Mime types not on the mime type configuration list always had `application/octet-stream` as a file extension and `APPLICATION/OCTET-STREAM file` as name and description. Now these information are just omitted. + +https://github.com/cs3org/reva/pull/2149 +https://github.com/owncloud/ocis/pull/2603 +https://github.com/cs3org/reva/pull/2138 diff --git a/internal/grpc/services/appregistry/appregistry.go b/internal/grpc/services/appregistry/appregistry.go index 035f240029..4b8c08f6d7 100644 --- a/internal/grpc/services/appregistry/appregistry.go +++ b/internal/grpc/services/appregistry/appregistry.go @@ -151,6 +151,13 @@ func (s *svc) ListSupportedMimeTypes(ctx context.Context, req *registrypb.ListSu }, nil } + // hide mimetypes for app providers + for _, mime := range mimeTypes { + for _, app := range mime.AppProviders { + app.MimeTypes = nil + } + } + res := ®istrypb.ListSupportedMimeTypesResponse{ Status: status.NewOK(ctx), MimeTypes: mimeTypes, diff --git a/pkg/app/registry/static/static.go b/pkg/app/registry/static/static.go index 8f800e17a1..2380f45e9c 100644 --- a/pkg/app/registry/static/static.go +++ b/pkg/app/registry/static/static.go @@ -29,7 +29,6 @@ import ( "github.com/cs3org/reva/pkg/app" "github.com/cs3org/reva/pkg/app/registry/registry" "github.com/cs3org/reva/pkg/errtypes" - "github.com/cs3org/reva/pkg/mime" "github.com/mitchellh/mapstructure" "github.com/rs/zerolog/log" orderedmap "github.com/wk8/go-ordered-map" @@ -265,14 +264,12 @@ func (m *manager) SetDefaultProviderForMimeType(ctx context.Context, mimeType st } func dummyMimeType(m string, apps []*registrypb.ProviderInfo) *mimeTypeConfig { - ext := mime.Detect(false, m) - return &mimeTypeConfig{ - MimeType: m, - apps: apps, - Extension: ext, - Name: fmt.Sprintf("%s file", strings.ToUpper(ext)), - Description: fmt.Sprintf("%s file", strings.ToUpper(ext)), + MimeType: m, + apps: apps, + //Extension: "", // there is no meaningful general extension, so omit it + //Name: "", // there is no meaningful general name, so omit it + //Description: "", // there is no meaningful general description, so omit it } }