cli: Print out available tus extensions

This commit is contained in:
Marius 2019-09-10 15:26:37 +02:00
parent d01d878e29
commit 241c458184
2 changed files with 8 additions and 1 deletions

View File

@ -54,7 +54,7 @@ func Serve() {
SetupHookMetrics() 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 // 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. // path. Else this would cause a "multiple registrations for /" panic.

View File

@ -155,6 +155,13 @@ func NewUnroutedHandler(config Config) (*UnroutedHandler, error) {
return handler, nil 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 // Middleware checks various aspects of the request and ensures that it
// conforms with the spec. Also handles method overriding for clients which // conforms with the spec. Also handles method overriding for clients which
// cannot make PATCH AND DELETE requests. If you are using the tusd handlers // cannot make PATCH AND DELETE requests. If you are using the tusd handlers