From 96deb187c19296bec0253f91329d39aa42d08434 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Tue, 19 May 2020 16:29:12 +0200 Subject: [PATCH] Add option in config to disable tus (#759) --- internal/http/services/dataprovider/dataprovider.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/http/services/dataprovider/dataprovider.go b/internal/http/services/dataprovider/dataprovider.go index 519755283e..cb5634b192 100644 --- a/internal/http/services/dataprovider/dataprovider.go +++ b/internal/http/services/dataprovider/dataprovider.go @@ -35,9 +35,10 @@ func init() { } type config struct { - Prefix string `mapstructure:"prefix"` - Driver string `mapstructure:"driver"` - Drivers map[string]map[string]interface{} `mapstructure:"drivers"` + Prefix string `mapstructure:"prefix"` + Driver string `mapstructure:"driver"` + Drivers map[string]map[string]interface{} `mapstructure:"drivers"` + DisableTus bool `mapstructure:"disable_tus"` } type svc struct { @@ -107,7 +108,7 @@ type Composable interface { func (s *svc) setHandler() (err error) { composable, ok := s.storage.(Composable) - if ok { + if ok && !s.conf.DisableTus { // A storage backend for tusd may consist of multiple different parts which // handle upload creation, locking, termination and so on. The composer is a // place where all those separated pieces are joined together. In this example