[FIX] Missing ending slash on publicFilePath of fileUpload (#15506)

* [FIX] Missing ending slash on publicFilePath of fileUpload

* Use getURL isntead of Meteor.absoluteUrl
pull/15546/head
Rodrigo Nascimento 6 years ago committed by Renato Becker
parent 3edd07b359
commit f87e60fc56
  1. 4
      app/utils/server/functions/normalizeMessageFileUpload.js

@ -1,6 +1,6 @@
import { getURL } from '../../lib/getURL';
import { FileUpload } from '../../../file-upload/server';
import { Uploads } from '../../../models/server';
import { settings } from '../../../settings/server';
export const normalizeMessageFileUpload = (message) => {
if (message.file && !message.fileUpload) {
@ -10,7 +10,7 @@ export const normalizeMessageFileUpload = (message) => {
return message;
}
message.fileUpload = {
publicFilePath: `${ settings.get('Site_Url') }${ FileUpload.getPath(`${ file._id }/${ encodeURI(file.name) }`).substring(1) }${ jwt ? `?token=${ jwt }` : '' }`,
publicFilePath: getURL(`${ FileUpload.getPath(`${ file._id }/${ encodeURI(file.name) }`).substring(1) }${ jwt ? `?token=${ jwt }` : '' }`, { cdn: false, full: true }),
type: file.type,
size: file.size,
};

Loading…
Cancel
Save