mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 18:03:47 +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 || {});
|
||||
try {
|
||||
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);
|
||||
} catch (err) {
|
||||
logger.error(LogOrigin.Tx, `HTTP Integration: ${err}`);
|
||||
return {
|
||||
success: false,
|
||||
message: `${err}`,
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user