Explorar o código

no file subtype can be an issue, added a check on it in the keybuilder

Henry Oswald %!s(int64=11) %!d(string=hai) anos
pai
achega
7c2e4b00ed
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      services/filestore/app/coffee/KeyBuilder.coffee

+ 3 - 1
services/filestore/app/coffee/KeyBuilder.coffee

@@ -25,7 +25,9 @@ module.exports =
 		
 	templateFileKey: (req, res, next)->
 		{template_id, format, version, sub_type} = req.params
-		req.key = "#{template_id}/v/#{version}/#{format}/#{sub_type}"
+		req.key = "#{template_id}/v/#{version}/#{format}"
+		if sub_type?
+			req.key = "#{req.key}/#{sub_type}"
 		req.bucket = settings.filestore.stores.template_files
 		req.version = version
 		opts = req.query