|
1 | 1 | import { S3UseCases } from '../../../core/s3/index.js' |
2 | 2 | import { handleError } from '../../../errors/index.js' |
3 | 3 | import { handleS3Auth } from '../../../infrastructure/services/auth/s3.js' |
4 | | -import { getByteRange } from '../../../shared/utils/http.js' |
5 | 4 | import { |
| 5 | + getByteRange, |
6 | 6 | handleDownloadResponseHeaders, |
7 | 7 | handleS3DownloadResponseHeaders, |
8 | | -} from '../../../shared/httpHandlers/download.js' |
| 8 | +} from '@autonomys/file-server' |
9 | 9 | import { pipeline } from 'stream' |
10 | 10 | import { createLogger } from '../../../infrastructure/drivers/logger.js' |
11 | 11 | import { Request, Response } from 'express' |
@@ -60,7 +60,9 @@ export const getObjectHandler = async (req: Request, res: Response) => { |
60 | 60 | byteRange: resultingByteRange, |
61 | 61 | } = downloadResult.value |
62 | 62 |
|
63 | | - handleDownloadResponseHeaders(req, res, metadata, resultingByteRange) |
| 63 | + handleDownloadResponseHeaders(req, res, metadata, { |
| 64 | + byteRange: resultingByteRange, |
| 65 | + }) |
64 | 66 | handleS3DownloadResponseHeaders(req, res, metadata) |
65 | 67 |
|
66 | 68 | pipeline(await startDownload(), res, (err: Error | null) => { |
@@ -93,7 +95,9 @@ export const headObjectHandler = async (req: Request, res: Response) => { |
93 | 95 | } |
94 | 96 | const { metadata, byteRange: resultingByteRange } = downloadResult.value |
95 | 97 |
|
96 | | - handleDownloadResponseHeaders(req, res, metadata, resultingByteRange) |
| 98 | + handleDownloadResponseHeaders(req, res, metadata, { |
| 99 | + byteRange: resultingByteRange, |
| 100 | + }) |
97 | 101 | handleS3DownloadResponseHeaders(req, res, metadata) |
98 | 102 |
|
99 | 103 | res.sendStatus(204) |
|
0 commit comments