Skip to content

Commit 2e830bf

Browse files
committed
fix: applied host to define environment/branch
1 parent 142715e commit 2e830bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class CoCreateLazyLoader {
6262
if (valideUrl.pathname.startsWith('/webhooks/')) {
6363
let name = req.url.split('/')[2]; // Assuming URL structure is /webhook/name/...
6464
if (this.modules[name]) {
65-
this.executeScriptWithTimeout(name, { req, res, organization, valideUrl, organization_id: organization._id })
65+
this.executeScriptWithTimeout(name, { req, res, host: hostname, organization, valideUrl, organization_id: organization._id })
6666
} else {
6767
// Handle unknown module or missing webhook method
6868
res.writeHead(404, { 'Content-Type': 'application/json' });
@@ -210,6 +210,7 @@ function clearModuleCache(name) {
210210
async function fetchScriptFromDatabaseAndSave(name, moduleConfig) {
211211
let data = {
212212
method: 'object.read',
213+
host: moduleConfig.object.hostname,
213214
array: moduleConfig.array,
214215
$filter: {
215216
query: [

0 commit comments

Comments
 (0)