Skip to content
Snippets Groups Projects
Unverified Commit 50ee03b1 authored by Diego Sampaio's avatar Diego Sampaio
Browse files

Fix previous commits

parent abdc6c6a
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ WebApp.connectHandlers.use('/file-upload/', function(req, res, next) {
}
}
res.header('Content-Security-Policy', 'default-src \'none\'');
res.setHeader('Content-Security-Policy', 'default-src \'none\'');
return FileUpload.get(file, req, res, next);
}
......
import moment from 'moment'
Template.messageAttachment.helpers
fixCordova: (url) ->
if url?.indexOf('data:image') is 0
return url
fixCordova = (url) ->
if url?.indexOf('data:image') is 0
return url
if Meteor.isCordova and url?[0] is '/'
url = Meteor.absoluteUrl().replace(/\/$/, '') + url
query = "rc_uid=#{Meteor.userId()}&rc_token=#{Meteor._localStorage.getItem('Meteor.loginToken')}"
if url.indexOf('?') is -1
url = url + '?' + query
else
url = url + '&' + query
if Meteor.settings.public.sandstorm or url.match /^(https?:)?\/\//i
return url
else if navigator.userAgent.indexOf('Electron') > -1
return __meteor_runtime_config__.ROOT_URL_PATH_PREFIX + url
if Meteor.isCordova and url?[0] is '/'
url = Meteor.absoluteUrl().replace(/\/$/, '') + url
query = "rc_uid=#{Meteor.userId()}&rc_token=#{Meteor._localStorage.getItem('Meteor.loginToken')}"
if url.indexOf('?') is -1
url = url + '?' + query
else
return Meteor.absoluteUrl().replace(/\/$/, '') + __meteor_runtime_config__.ROOT_URL_PATH_PREFIX + url
url = url + '&' + query
if Meteor.settings.public.sandstorm or url.match /^(https?:)?\/\//i
return url
else if navigator.userAgent.indexOf('Electron') > -1
return __meteor_runtime_config__.ROOT_URL_PATH_PREFIX + url
else
return Meteor.absoluteUrl().replace(/\/$/, '') + __meteor_runtime_config__.ROOT_URL_PATH_PREFIX + url
Template.messageAttachment.helpers
fixCordova: fixCordova
parsedText: ->
renderMessageBody { msg: this.text }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment