From d93fd7ab4d7fe9188c787dbf65e77c1648608cee Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 18 Aug 2022 11:55:19 +0200 Subject: [PATCH] fix configuration of mimetypes for the app registry --- .../unreleased/bugfix-app-registry-default-mimetypes.md | 8 ++++++++ ...pty-file => bugfix-idp-init-certificate-empty-file.md} | 0 .../app-registry/pkg/config/defaults/defaultconfig.go | 8 ++++---- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 changelog/unreleased/bugfix-app-registry-default-mimetypes.md rename changelog/unreleased/{bugfix-idp-init-certificate-empty-file => bugfix-idp-init-certificate-empty-file.md} (100%) diff --git a/changelog/unreleased/bugfix-app-registry-default-mimetypes.md b/changelog/unreleased/bugfix-app-registry-default-mimetypes.md new file mode 100644 index 0000000000..4d51f87133 --- /dev/null +++ b/changelog/unreleased/bugfix-app-registry-default-mimetypes.md @@ -0,0 +1,8 @@ +Bugfix: Fix configuration of mimetypes for the app registry + +We've fixed the configuration option for mimetypes in the app registry. +Previously the default config would always be merged over the user provided +configuration. Now the default mimetype configuration is only used if the user does not +providy any mimetype configuration (like it is already done in the proxy with the routes configuration). + +https://github.com/owncloud/ocis/pull/4411 diff --git a/changelog/unreleased/bugfix-idp-init-certificate-empty-file b/changelog/unreleased/bugfix-idp-init-certificate-empty-file.md similarity index 100% rename from changelog/unreleased/bugfix-idp-init-certificate-empty-file rename to changelog/unreleased/bugfix-idp-init-certificate-empty-file.md diff --git a/services/app-registry/pkg/config/defaults/defaultconfig.go b/services/app-registry/pkg/config/defaults/defaultconfig.go index 4846146f98..c754f4e506 100644 --- a/services/app-registry/pkg/config/defaults/defaultconfig.go +++ b/services/app-registry/pkg/config/defaults/defaultconfig.go @@ -30,9 +30,6 @@ func DefaultConfig() *config.Config { Reva: &config.Reva{ Address: "127.0.0.1:9142", }, - AppRegistry: config.AppRegistry{ - MimeTypeConfig: defaultMimeTypeConfig(), - }, } } @@ -150,6 +147,9 @@ func EnsureDefaults(cfg *config.Config) { } +// Sanitize the config func Sanitize(cfg *config.Config) { - // nothing to sanitize here atm + if cfg.AppRegistry.MimeTypeConfig == nil { + cfg.AppRegistry.MimeTypeConfig = defaultMimeTypeConfig() + } }