diff --git a/cmd/tusd/cli/serve.go b/cmd/tusd/cli/serve.go index 522ccb9..c5bc869 100644 --- a/cmd/tusd/cli/serve.go +++ b/cmd/tusd/cli/serve.go @@ -54,7 +54,7 @@ func Serve() { SetupHookMetrics() } - stdout.Printf(Composer.Capabilities()) + stdout.Printf("Supported tus extensions: %s\n", handler.SupportedExtensions()) // Do not display the greeting if the tusd handler will be mounted at the root // path. Else this would cause a "multiple registrations for /" panic. diff --git a/pkg/handler/unrouted_handler.go b/pkg/handler/unrouted_handler.go index 6312253..938ff2e 100644 --- a/pkg/handler/unrouted_handler.go +++ b/pkg/handler/unrouted_handler.go @@ -155,6 +155,13 @@ func NewUnroutedHandler(config Config) (*UnroutedHandler, error) { return handler, nil } +// SupportedExtensions returns a comma-separated list of the supported tus extensions. +// The availability of an extension usually depends on whether the provided data store +// implements some additional interfaces. +func (handler *UnroutedHandler) SupportedExtensions() string { + return handler.extensions +} + // Middleware checks various aspects of the request and ensures that it // conforms with the spec. Also handles method overriding for clients which // cannot make PATCH AND DELETE requests. If you are using the tusd handlers