Skip to content

Commit

Permalink
[FIX] Missing ending slash on publicFilePath of fileUpload
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigok committed Oct 4, 2019
1 parent 50589a3 commit cba9800
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/utils/server/functions/normalizeMessageFileUpload.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Meteor } from 'meteor/meteor';

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) {
Expand All @@ -10,7 +11,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: Meteor.absoluteUrl(`${ FileUpload.getPath(`${ file._id }/${ encodeURI(file.name) }`).substring(1) }${ jwt ? `?token=${ jwt }` : '' }`),
type: file.type,
size: file.size,
};
Expand Down

0 comments on commit cba9800

Please sign in to comment.