Merge pull request #4191 from FailedSitcom/master

Fix image url when using a third party
This commit is contained in:
Jim LAURIE 2019-10-05 14:13:13 +02:00 committed by GitHub
commit 8e2a6ec256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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