mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-24 00:19:21 +00:00
test for http protocol
This commit is contained in:
@@ -83,9 +83,20 @@ export class HttpIntegration implements IIntegration {
|
|||||||
const parsedMessage = parseTemplateNested(message, state || {});
|
const parsedMessage = parseTemplateNested(message, state || {});
|
||||||
try {
|
try {
|
||||||
const parsedUrl = new URL(parsedMessage);
|
const parsedUrl = new URL(parsedMessage);
|
||||||
|
if (parsedUrl.protocol !== 'http:') {
|
||||||
|
logger.error(LogOrigin.Tx, `HTTP Integration: Only HTTP allowed, got ${parsedUrl.protocol}`);
|
||||||
|
return {
|
||||||
|
success: false,
|
||||||
|
message: `Only HTTP allowed, got ${parsedUrl.protocol}`,
|
||||||
|
};
|
||||||
|
}
|
||||||
this.emit(parsedUrl);
|
this.emit(parsedUrl);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error(LogOrigin.Tx, `HTTP Integration: ${err}`);
|
logger.error(LogOrigin.Tx, `HTTP Integration: ${err}`);
|
||||||
|
return {
|
||||||
|
success: false,
|
||||||
|
message: `${err}`,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user