Conditionally include creation-defer-length if the composer supports it

This commit is contained in:
Adam Jensen 2018-06-03 12:15:50 -04:00
parent 0976863947
commit d545b6518b
1 changed files with 4 additions and 1 deletions

View File

@ -119,13 +119,16 @@ func NewUnroutedHandler(config Config) (*UnroutedHandler, error) {
} }
// Only promote extesions using the Tus-Extension header which are implemented // Only promote extesions using the Tus-Extension header which are implemented
extensions := "creation,creation-with-upload,creation-defer-length" extensions := "creation,creation-with-upload"
if config.StoreComposer.UsesTerminater { if config.StoreComposer.UsesTerminater {
extensions += ",termination" extensions += ",termination"
} }
if config.StoreComposer.UsesConcater { if config.StoreComposer.UsesConcater {
extensions += ",concatenation" extensions += ",concatenation"
} }
if config.StoreComposer.UsesLengthDeferrer {
extensions += ",creation-defer-length"
}
handler := &UnroutedHandler{ handler := &UnroutedHandler{
config: config, config: config,