Skip to content

Commit

Permalink
remove download option so deploy config can't be modified
Browse files Browse the repository at this point in the history
  • Loading branch information
ggwadera committed Sep 1, 2020
1 parent 704b582 commit 73a363a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
9 changes: 0 additions & 9 deletions src/api/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,6 @@ mappingRouter.delete('/:id', async (req, res) => {
})
})

mappingRouter.get('/download', (req, res) => {
const filePath = `${WORKPATH}/${req.query.fullDomain}/deploy.config.js`
res.setHeader('Content-disposition', 'attachment; filename=deploy.config.js')
res.setHeader('Content-type', 'application/javascript')
res.download(filePath, err => {
console.log('Failed to download file', err)
})
})

mappingRouter.get('/:id', (req, res) => {
const foundDomain = getMappingById(req.params.id)
res.json(foundDomain || {})
Expand Down
7 changes: 0 additions & 7 deletions src/public/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,6 @@ class MappingItem {
${data.gitLink}
</small>
</div>
<a
href="/api/mappings/download/?fullDomain=${data.fullDomain}"
target="_blank"
class="btn btn-sm btn-outline-success mr-3"
>
Download<i class="fa fa-download"></i>
</a>
<button
class="btn btn-sm btn-outline-danger mr-3 deleteButton"
type="button"
Expand Down

0 comments on commit 73a363a

Please sign in to comment.