diff --git a/src/routes-simple/index.ts b/src/routes-simple/index.ts index c508b96..29d91ab 100644 --- a/src/routes-simple/index.ts +++ b/src/routes-simple/index.ts @@ -1,6 +1,6 @@ -import './code/upload.ts'; +// import './code/upload.ts'; import './event.ts'; import './resources/upload.ts'; import './resources/chunk.ts'; -import './resources/get-resources.ts'; +// import './resources/get-resources.ts'; diff --git a/src/routes-simple/resources/get-resources.ts b/src/routes-simple/resources/get-resources.ts index cefee5c..5c95ad1 100644 --- a/src/routes-simple/resources/get-resources.ts +++ b/src/routes-simple/resources/get-resources.ts @@ -1,6 +1,9 @@ import { router } from '@/app.ts'; import { authMinio } from '../minio/get-minio-resource.ts'; + +// 功能可以抽离为某一个dns请求的服务 + router.all('/api/s1/share/*splat', async (req, res) => { try { const url = req.url; diff --git a/src/routes-simple/resources/util.ts b/src/routes-simple/resources/util.ts index 3bb6066..9de03d2 100644 --- a/src/routes-simple/resources/util.ts +++ b/src/routes-simple/resources/util.ts @@ -8,7 +8,7 @@ */ export const validateDirectory = (directory?: string) => { // 对directory进行校验,不能以/开头,不能以/结尾。不能以.开头,不能以.结尾。 - if (directory && (directory.startsWith('/') || directory.endsWith('/') || directory.startsWith('.') || directory.endsWith('.'))) { + if (directory && (directory.startsWith('/') || directory.endsWith('/') || directory.startsWith('..') || directory.endsWith('..'))) { return { code: 500, message: 'directory is invalid',