diff --git a/src/functions/project/file/get.js b/src/functions/project/file/get.js index 36d7481..d0adfae 100644 --- a/src/functions/project/file/get.js +++ b/src/functions/project/file/get.js @@ -5,8 +5,6 @@ import projectService from 'services/project' import authorize from 'middlewares/authorize' import config from 'infrastructure/config' -import head from './head' - export default authorize([ config.apps.WEBAPP, config.apps.JOB_LOOP, @@ -16,7 +14,21 @@ export default authorize([ ])(resource('FILE')( async (req) => { if (req.httpMethod === 'HEAD') { - return await head.logic(req) + const { projectIdentifier, fileIdentifier } = req.pathParameters + const result = await projectService.file.head( + projectIdentifier, + decodeURIComponent(fileIdentifier) + ) + + if (!result) { + throw { + statusCode: NOT_FOUND + } + } + + return { + statusCode: OK + } } const { projectIdentifier, fileIdentifier } = req.pathParameters