mirror of
https://github.com/strapi/strapi.git
synced 2025-12-25 06:04:29 +00:00
use resolve
Signed-off-by: Pierre Noël <petersg83@gmail.com>
This commit is contained in:
parent
c8207b7809
commit
bc96123485
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const { join, isAbsolute } = require('path');
|
||||
const { resolve } = require('path');
|
||||
const range = require('koa-range');
|
||||
const koaStatic = require('koa-static');
|
||||
|
||||
@ -10,9 +10,7 @@ module.exports = strapi => ({
|
||||
'middleware.settings.public.path',
|
||||
strapi.config.paths.static
|
||||
);
|
||||
const staticDir = isAbsolute(configPublicPath)
|
||||
? configPublicPath
|
||||
: join(strapi.dir, configPublicPath);
|
||||
const staticDir = resolve(strapi.dir, configPublicPath);
|
||||
|
||||
strapi.app.on('error', err => {
|
||||
if (err.code === 'EPIPE') {
|
||||
|
||||
@ -27,9 +27,8 @@ module.exports = {
|
||||
'middleware.settings.public.path',
|
||||
strapi.config.paths.static
|
||||
);
|
||||
const uploadDir = path.isAbsolute(configPublicPath)
|
||||
? configPublicPath
|
||||
: path.join(strapi.dir, configPublicPath);
|
||||
|
||||
const uploadDir = path.resolve(strapi.dir, configPublicPath);
|
||||
|
||||
return {
|
||||
upload(file) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user