Skip to content

Commit

Permalink
Fix corrupted export functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
amazon-meaisiah committed Mar 20, 2020
1 parent e71ba86 commit 76605bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lambdas/backend/__tests__/routes/catalog/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('GET /catalog/:apiId/export', () => {
})

expect(res.send).toHaveBeenCalledTimes(1)
expect(res.send.mock.calls[0][0]).toContain('data:application/zip;base64,')
expect(res.send.mock.calls[0][0]).toBeInstanceOf(Buffer)
})

test('it should not return SDKs for APIs not in the catalog', async () => {
Expand Down
6 changes: 1 addition & 5 deletions lambdas/backend/routes/catalog/export.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict'

const Datauri = require('datauri')
const util = require('../../util')

exports.get = async (req, res) => {
Expand Down Expand Up @@ -32,9 +31,6 @@ exports.get = async (req, res) => {
parameters
}).promise()).body

const datauri = new Datauri()
datauri.format('.zip', resultsBuffer)

res.send(datauri.content)
res.send(resultsBuffer)
}
}

0 comments on commit 76605bd

Please sign in to comment.