only add backend host as prefix if local server upload when getting singular upload

This commit is contained in:
Samuel Durkin 2019-10-04 19:06:01 +02:00
parent 2d04d25097
commit ffdde168c5

View File

@ -182,7 +182,11 @@ module.exports = {
return ctx.notFound('file.notFound');
}
// if is local server upload, add backend host as prefix
if (data.url[0] === '/') {
data.url = strapi.config.url + data.url;
}
ctx.send(data);
},