@cocreate/file-server 1.0.19 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.0.21](https://github.com/CoCreate-app/CoCreate-file-server/compare/v1.0.20...v1.0.21) (2022-12-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * testing ([a9b246d](https://github.com/CoCreate-app/CoCreate-file-server/commit/a9b246d9ed42395b81ae60b82f19e98025e72a7b))
7
+
8
+ ## [1.0.20](https://github.com/CoCreate-app/CoCreate-file-server/compare/v1.0.19...v1.0.20) (2022-12-05)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * testing ([215f057](https://github.com/CoCreate-app/CoCreate-file-server/commit/215f05757ce6138e9e45df2491b4143416b49c96))
14
+
1
15
  ## [1.0.19](https://github.com/CoCreate-app/CoCreate-file-server/compare/v1.0.18...v1.0.19) (2022-12-05)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/file-server",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "A simple file-server component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "file-server",
package/src/index.js CHANGED
@@ -93,17 +93,16 @@ class CoCreateFileSystem {
93
93
  console.log('src', contentType)
94
94
 
95
95
  if (contentType.startsWith('image/') || contentType.startsWith('audio/') || contentType.startsWith('video/')) {
96
- console.log('before media', contentType, src)
97
96
 
98
97
  var base64Data = src.replace(/^data:image\/(png|jpeg|jpg);base64,/, '');
99
98
  let file = Buffer.from(base64Data, 'base64');
100
- console.log('file', contentType, file)
101
99
 
102
- res.writeHead(200, {
103
- 'Content-Type': contentType,
104
- 'Content-Length': file.length
105
- });
106
- console.log('after write', contentType)
100
+ // res.writeHead(200, {
101
+ // 'Content-Type': contentType,
102
+ // 'Content-Length': file.length
103
+ // });
104
+ console.log('after', contentType)
105
+ res.type(contentType);
107
106
  res.send(file);
108
107
  } else if (contentType === 'text/html') {
109
108
  try {