@cocreate/lazy-loader 1.13.0 → 1.13.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 +14 -0
- package/package.json +1 -1
- package/src/server.js +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.13.2](https://github.com/CoCreate-app/CoCreate-lazy-loader/compare/v1.13.1...v1.13.2) (2024-01-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* send req.url to acme ([66715f9](https://github.com/CoCreate-app/CoCreate-lazy-loader/commit/66715f97ea85a23087b29a8ab45c47db35199f92))
|
|
7
|
+
|
|
8
|
+
## [1.13.1](https://github.com/CoCreate-app/CoCreate-lazy-loader/compare/v1.13.0...v1.13.1) (2024-01-01)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* fs.access error handling ([e3e61f6](https://github.com/CoCreate-app/CoCreate-lazy-loader/commit/e3e61f69d0728e437ce7980862cb4c72aa9bb34f))
|
|
14
|
+
|
|
1
15
|
# [1.13.0](https://github.com/CoCreate-app/CoCreate-lazy-loader/compare/v1.12.2...v1.13.0) (2023-12-31)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -22,7 +22,10 @@ class CoCreateLazyLoader {
|
|
|
22
22
|
async init() {
|
|
23
23
|
const scriptsDirectory = './scripts';
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
try {
|
|
26
|
+
await fs.access(directory);
|
|
27
|
+
console.log("The directory exists.");
|
|
28
|
+
} catch (error) {
|
|
26
29
|
try {
|
|
27
30
|
await fs.mkdir(scriptsDirectory, { recursive: true });
|
|
28
31
|
console.log(`Scripts directory created at ${scriptsDirectory}`);
|
|
@@ -63,6 +66,7 @@ class CoCreateLazyLoader {
|
|
|
63
66
|
})
|
|
64
67
|
|
|
65
68
|
if (!org || !org.object || !org.object[0]) {
|
|
69
|
+
// TODO: hostNotFound is not defined
|
|
66
70
|
if (!hostNotFound)
|
|
67
71
|
hostNotFound = await getDefaultFile('/hostNotFound.html')
|
|
68
72
|
return sendResponse(hostNotFound.object[0].src, 404, { 'Content-Type': 'text/html', 'storage': organization.storage })
|
|
@@ -74,7 +78,7 @@ class CoCreateLazyLoader {
|
|
|
74
78
|
|
|
75
79
|
hosts[hostname] = organization
|
|
76
80
|
|
|
77
|
-
await this.acme.checkCertificate(hostname, organization._id)
|
|
81
|
+
await this.acme.checkCertificate(hostname, organization._id, req.url)
|
|
78
82
|
|
|
79
83
|
if (valideUrl.pathname.startsWith('/webhooks/')) {
|
|
80
84
|
let name = req.url.split('/')[2]; // Assuming URL structure is /webhook/name/...
|