@cocreate/file-server 1.11.4 → 1.12.1

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.12.1](https://github.com/CoCreate-app/CoCreate-file-server/compare/v1.12.0...v1.12.1) (2023-10-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bump dependencies ([306cd2a](https://github.com/CoCreate-app/CoCreate-file-server/commit/306cd2a4dc252202e9beecec8ffb3d0f1d4abb0f))
7
+
8
+ # [1.12.0](https://github.com/CoCreate-app/CoCreate-file-server/compare/v1.11.4...v1.12.0) (2023-10-22)
9
+
10
+
11
+ ### Features
12
+
13
+ * Identify base64 strings and convert to buffer for response ([1005ab3](https://github.com/CoCreate-app/CoCreate-file-server/commit/1005ab3a787170be4ec62c26f0daa16ced4f37b6))
14
+
1
15
  ## [1.11.4](https://github.com/CoCreate-app/CoCreate-file-server/compare/v1.11.3...v1.11.4) (2023-10-14)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/file-server",
3
- "version": "1.11.4",
3
+ "version": "1.12.1",
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
@@ -144,9 +144,7 @@ class CoCreateFileSystem {
144
144
  }
145
145
 
146
146
  let contentType = file['content-type'] || 'text/html';
147
- if (contentType === 'image/svg+xml')
148
- contentType = contentType
149
- else if (contentType.startsWith('image/') || contentType.startsWith('audio/') || contentType.startsWith('video/')) {
147
+ if (/^[A-Za-z0-9+/]+[=]{0,2}$/.test(src)) {
150
148
  src = src.replace(/^data:image\/(png|jpeg|jpg);base64,/, '');
151
149
  src = Buffer.from(src, 'base64');
152
150
  } else if (contentType === 'text/html') {