@@ -47,8 +47,8 @@ class CoCreateLazyLoader {
47
47
async request ( req , res ) {
48
48
try {
49
49
// TODO: track usage
50
- const valideUrl = new URL ( `http://${ req . headers . host } ${ req . url } ` ) ;
51
- const hostname = valideUrl . hostname ;
50
+ const urlObject = new URL ( `http://${ req . headers . host } ${ req . url } ` ) ;
51
+ const hostname = urlObject . hostname ;
52
52
let organization ;
53
53
54
54
try {
@@ -61,19 +61,19 @@ class CoCreateLazyLoader {
61
61
res ,
62
62
this . crud ,
63
63
organization ,
64
- valideUrl
64
+ urlObject
65
65
) ;
66
66
}
67
67
68
- if ( valideUrl . pathname . startsWith ( "/webhooks/" ) ) {
68
+ if ( urlObject . pathname . startsWith ( "/webhooks/" ) ) {
69
69
let name = req . url . split ( "/" ) [ 2 ] ; // Assuming URL structure is /webhooks/name/...
70
70
if ( this . modules [ name ] ) {
71
71
this . executeScriptWithTimeout ( name , {
72
72
req,
73
73
res,
74
74
host : hostname ,
75
75
organization,
76
- valideUrl ,
76
+ urlObject ,
77
77
organization_id : organization . _id
78
78
} ) ;
79
79
} else {
@@ -82,7 +82,7 @@ class CoCreateLazyLoader {
82
82
res . end ( JSON . stringify ( { error : "Not found" } ) ) ;
83
83
}
84
84
} else {
85
- this . files . send ( req , res , this . crud , organization , valideUrl ) ;
85
+ this . files . send ( req , res , this . crud , organization , urlObject ) ;
86
86
}
87
87
} catch ( error ) {
88
88
res . writeHead ( 400 , { "Content-Type" : "text/plain" } ) ;
0 commit comments