@cocreate/file-server 1.15.1 → 1.15.2

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,10 @@
1
+ ## [1.15.2](https://github.com/CoCreate-app/CoCreate-file-server/compare/v1.15.1...v1.15.2) (2023-12-31)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * handling wellknown and fix modified on bug ([987d161](https://github.com/CoCreate-app/CoCreate-file-server/commit/987d1612797ea70c300c3f1472c11bf10b38efb2))
7
+
1
8
  ## [1.15.1](https://github.com/CoCreate-app/CoCreate-file-server/compare/v1.15.0...v1.15.1) (2023-12-18)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/file-server",
3
- "version": "1.15.1",
3
+ "version": "1.15.2",
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
@@ -44,7 +44,7 @@ class CoCreateFileSystem {
44
44
  let pathname = valideUrl.pathname;
45
45
  if (pathname.endsWith('/')) {
46
46
  pathname += "index.html";
47
- } else {
47
+ } else if (!pathname.startsWith('/.well-known/acme-challenge')) {
48
48
  let directory = pathname.split("/").slice(-1)[0];
49
49
  if (!directory.includes('.'))
50
50
  pathname += "/index.html";
@@ -107,8 +107,9 @@ class CoCreateFileSystem {
107
107
  }
108
108
 
109
109
 
110
- if (file.modified || file.created) {
111
- let modifiedOn = file.modified.on || file.created.on
110
+ let modifiedOn = file.modified || file.created
111
+ if (modifiedOn) {
112
+ modifiedOn = modifiedOn.on
112
113
  if (modifiedOn instanceof Date)
113
114
  modifiedOn = modifiedOn.toISOString()
114
115
  res.setHeader('Last-Modified', modifiedOn);