 				writer.writeElement 'timestamp', String(Math.floor (do version.timestamp.getTime) / 1000)
 				
 				# e.g. #{host}/com.example.wcf.test/1.0.0_Alpha_15
-				writer.writeElement 'file', "#{host}/#{_package.name}/#{versionNumber.toLowerCase().replace (new RegExp ' ', 'g'), '_'}"
+				writer.writeElement 'file', "#{host}/#{_package.name}/#{versionNumber.toLowerCase().replace /[ ]/g, '_'}"
 				
 				# try to extract license
 				if version.license

logDownload = (packageName, version) ->
	return unless config.enableStatistics
	
	version = version.toLowerCase().replace (new RegExp ' ', 'g'), '_'
	unless downloadCounterFiles[packageName]?[version]?
		downloadCounterFiles[packageName] = { } unless downloadCounterFiles[packageName]?
		downloadCounterFiles[packageName][version] = 0

	unless versionNumber?
		res.sendStatus 404
		return
	res.redirect 301, "#{host}/#{req.params[0]}/#{versionNumber.toLowerCase().replace /[ ]/g, '_'}"

app.get '/app.coffee', (req, res) -> res.type('txt').sendFile "#{__dirname}/app.coffee", (err) -> res.sendStatus 404 if err?

