Add a try catch around lti url parsing

This commit is contained in:
Mészáros Mihály 2020-05-29 07:46:22 +02:00
parent aa678d03e8
commit dd09a60880

View file

@ -421,7 +421,16 @@ async function runHttpsServer()
{
if (req.secure || config.httpOnly)
{
const ltiURL = new URL(`${req.protocol }://${ req.get('host') }${req.originalUrl}`);
let ltiURL;
try
{
ltiURL = new URL(`${req.protocol }://${ req.get('host') }${req.originalUrl}`);
}
catch (error)
{
logger.error('Error parsing LTI url: %o', error);
}
if (
req.isAuthenticated &&