update to add widget section
This commit is contained in:
@ -406,10 +406,11 @@ app.get('/widget/:edition/:host/:port', (req, res) => {
|
||||
try {
|
||||
validateEdition(edition);
|
||||
validateHostname(host);
|
||||
if (host !== 'my-mc.link') {
|
||||
logger.error('Unauthorized hostname', { host });
|
||||
throw new Error('Hostname must be my-mc.link');
|
||||
}
|
||||
// Uncomment this to only allow our system servers to have widgets.
|
||||
// if (host !== 'my-mc.link') {
|
||||
// logger.error('Unauthorized hostname', { host });
|
||||
// throw new Error('Hostname must be my-mc.link');
|
||||
// }
|
||||
validatePort(port);
|
||||
res.setHeader('Content-Type', 'text/html');
|
||||
res.send(widgetTemplate(edition, host, port));
|
||||
|
Reference in New Issue
Block a user