fix bugs
This commit is contained in:
parent
391c43c6b7
commit
d29f69452c
@ -97,7 +97,6 @@ export const authMinio = async (req: IncomingMessage, res: ServerResponse, objec
|
|||||||
etag,
|
etag,
|
||||||
'last-modified': lastModified,
|
'last-modified': lastModified,
|
||||||
'Content-Disposition': contentDisposition,
|
'Content-Disposition': contentDisposition,
|
||||||
'file-name': filename,
|
|
||||||
...filteredMetaData,
|
...filteredMetaData,
|
||||||
});
|
});
|
||||||
const objectStream = await minioClient.getObject(bucketName, objectName);
|
const objectStream = await minioClient.getObject(bucketName, objectName);
|
||||||
|
@ -5,7 +5,8 @@ router.all('/api/s1/share/*splat', async (req, res) => {
|
|||||||
try {
|
try {
|
||||||
const url = req.url;
|
const url = req.url;
|
||||||
const _url = new URL(url || '', 'http://localhost');
|
const _url = new URL(url || '', 'http://localhost');
|
||||||
const objectName = _url.pathname.replace('/api/s1/share/', '');
|
let objectName = _url.pathname.replace('/api/s1/share/', '');
|
||||||
|
objectName = decodeURIComponent(objectName);
|
||||||
await authMinio(req, res, objectName);
|
await authMinio(req, res, objectName);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('get share resource error url', req.url);
|
console.log('get share resource error url', req.url);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user