Skip to content

Commit

Permalink
Merge pull request #4989 from mnaamani/colossus-dont-serve-from-pending
Browse files Browse the repository at this point in the history
colossus: do not serve content from pending folder
  • Loading branch information
mnaamani committed Dec 5, 2023
2 parents 95dabab + 49b8d7b commit 5d911ce
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions storage-node/src/services/webApi/controllers/filesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ export async function getFile(

const dataObjectId = new BN(req.params.id)
const uploadsDir = res.locals.uploadsDir
const pendingObjectsDir = res.locals.pendingDataObjectsDir
const pending = res.locals.acceptPendingObjectsService.getPendingDataObject(dataObjectId.toString())

const fullPath = path.resolve(pending ? pendingObjectsDir : uploadsDir, dataObjectId.toString())
const fullPath = path.resolve(uploadsDir, dataObjectId.toString())

const fileInfo = await getFileInfo(fullPath)
const fileStats = await fsPromises.stat(fullPath)
Expand All @@ -54,7 +52,6 @@ export async function getFile(
res.setHeader('Content-Disposition', 'inline')
res.setHeader('Content-Type', fileInfo.mimeType)
res.setHeader('Content-Length', fileStats.size)
res.setHeader('X-Status', pending ? 'pending' : 'accepted')
})

stream.on('error', (err) => {
Expand Down

0 comments on commit 5d911ce

Please sign in to comment.