Skip to content

Commit

Permalink
fix: testing
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Dec 5, 2022
1 parent 1e3bc80 commit a9b246d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,15 @@ class CoCreateFileSystem {
console.log('src', contentType)

if (contentType.startsWith('image/') || contentType.startsWith('audio/') || contentType.startsWith('video/')) {
console.log('before media', contentType, src)

var base64Data = src.replace(/^data:image\/(png|jpeg|jpg);base64,/, '');
let file = Buffer.from(base64Data, 'base64');
console.log('file', contentType, file)

// res.writeHead(200, {
// 'Content-Type': contentType,
// 'Content-Length': file.length
// });
console.log('after write', contentType)
console.log('after', contentType)
res.type(contentType);
res.send(file);
} else if (contentType === 'text/html') {
Expand Down

0 comments on commit a9b246d

Please sign in to comment.