add missing options

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2023-07-24 15:15:01 +02:00
parent 6ff8a3cd27
commit 3eb6e74535
7 changed files with 25 additions and 11 deletions
+13 -6
View File
@@ -63,12 +63,13 @@ type Options struct {
MetricsSubsystem string
// ocdav.* is internal so we need to set config options individually
config config.Config
lockSystem ocdav.LockSystem
AllowCredentials bool
AllowedOrigins []string
AllowedHeaders []string
AllowedMethods []string
config config.Config
lockSystem ocdav.LockSystem
AllowCredentials bool
AllowedOrigins []string
AllowedHeaders []string
AllowedMethods []string
AllowDepthInfinity bool
}
// newOptions initializes the available default options.
@@ -103,6 +104,12 @@ func Address(val string) Option {
}
}
func AllowDepthInfinity(val bool) Option {
return func(o *Options) {
o.AllowDepthInfinity = val
}
}
// JWTSecret provides a function to set the jwt secret option.
func JWTSecret(s string) Option {
return func(o *Options) {
+3
View File
@@ -155,6 +155,9 @@ func setDefaults(sopts *Options) error {
if sopts.config.VersionString == "" {
sopts.config.VersionString = "0.0.0"
}
sopts.config.AllowPropfindDepthInfinitiy = sopts.AllowDepthInfinity
return nil
}