fix upload permissions introduced in raik:ufs 0.3.4

pull/1729/head
Diego Sampaio 10 years ago
parent 2797531040
commit 1a3796fd06
  1. 8
      lib/fileUpload.coffee

@ -74,13 +74,11 @@ if UploadFS?
token = cookie.get('rc_token', rawCookies) if rawCookies?
unless uid and token and RocketChat.models.Users.findOneByIdAndLoginToken(uid, token)
res.statusCode = 403
res.end('Not Allowed')
# Just to abort the request
# See https://github.com/jalik/jalik-ufs/issues/28
throw new Meteor.Error 403, 'Not Allowed'
res.writeHead 403
return false
res.setHeader 'content-disposition', "attachment; filename=\"#{ encodeURIComponent(file.name) }\""
return true
Meteor.startup ->
if Meteor.isServer

Loading…
Cancel
Save