@@ -10,8 +10,8 @@ const hosts = {};
10
10
class CoCreateLazyLoader {
11
11
constructor ( server , crud , files ) {
12
12
this . server = server
13
+ // this.acme = server.acme
13
14
this . wsManager = crud . wsManager
14
- this . acme = crud . wsManager . acme
15
15
this . crud = crud
16
16
this . files = files
17
17
this . exclusion = { ...require . cache } ;
@@ -47,13 +47,14 @@ class CoCreateLazyLoader {
47
47
} ) ;
48
48
}
49
49
50
- this . server . https . on ( 'request' , ( req , res ) => this . request ( req , res ) )
51
- this . server . http . on ( 'request' , ( req , res ) => this . request ( req , res ) )
50
+ this . server . https . on ( 'request' , ( req , res ) => this . request ( req , res , 'HTTPS' ) )
51
+ this . server . http . on ( 'request' , ( req , res ) => this . request ( req , res , 'HTTP' ) )
52
52
53
53
}
54
54
55
- async request ( req , res ) {
55
+ async request ( req , res , protocol ) {
56
56
try {
57
+ console . log ( 'server' , protocol )
57
58
const valideUrl = new URL ( `http://${ req . headers . host } ${ req . url } ` ) ;
58
59
const hostname = valideUrl . hostname ;
59
60
@@ -83,7 +84,7 @@ class CoCreateLazyLoader {
83
84
84
85
hosts [ hostname ] = organization
85
86
86
- await this . acme . checkCertificate ( hostname , organization . _id , req . url )
87
+ // await this.acme.checkCertificate(hostname, organization._id, req.url)
87
88
88
89
if ( valideUrl . pathname . startsWith ( '/webhooks/' ) ) {
89
90
let name = req . url . split ( '/' ) [ 2 ] ; // Assuming URL structure is /webhook/name/...
0 commit comments