mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
[skip-ci] update redirect checks
This commit is contained in:
@@ -155,35 +155,23 @@ async function handleCertificate(client, collection, domain) {
|
||||
return certificate;
|
||||
}
|
||||
|
||||
app.use('/', async function(req, res, next) {
|
||||
app.use(async function(req, res, next) {
|
||||
const host = req.hostname;
|
||||
const completeUrl = `https://${host}${req.url}`;
|
||||
|
||||
try {
|
||||
if (host && host === 'fyipe.com') {
|
||||
if (host && completeUrl === 'https://fyipe.com/') {
|
||||
res.writeHead(301, {
|
||||
Location: `https://oneuptime.com?redirectedFromOldBranding=true`,
|
||||
});
|
||||
return res.end();
|
||||
}
|
||||
if (host && host === 'staging.fyipe.com') {
|
||||
if (host && completeUrl === 'https://staging.fyipe.com/') {
|
||||
res.writeHead(301, {
|
||||
Location: `https://staging.oneuptime.com?redirectedFromOldBranding=true`,
|
||||
});
|
||||
return res.end();
|
||||
}
|
||||
|
||||
return next();
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Status Page: Error with fetch', error);
|
||||
return next();
|
||||
}
|
||||
});
|
||||
|
||||
app.use(async function(req, res, next) {
|
||||
const host = req.hostname;
|
||||
|
||||
try {
|
||||
if (host && host === 'fyipe.com') {
|
||||
res.writeHead(301, {
|
||||
Location: `https://oneuptime.com${req.url}`,
|
||||
@@ -205,6 +193,31 @@ app.use(async function(req, res, next) {
|
||||
}
|
||||
});
|
||||
|
||||
// app.use(async function(req, res, next) {
|
||||
// const host = req.hostname;
|
||||
|
||||
// try {
|
||||
// if (host && host === 'fyipe.com') {
|
||||
// res.writeHead(301, {
|
||||
// Location: `https://oneuptime.com${req.url}`,
|
||||
// });
|
||||
// return res.end();
|
||||
// }
|
||||
// if (host && host === 'staging.fyipe.com') {
|
||||
// res.writeHead(301, {
|
||||
// Location: `https://staging.oneuptime.com${req.url}`,
|
||||
// });
|
||||
// return res.end();
|
||||
// }
|
||||
|
||||
// return next();
|
||||
// } catch (error) {
|
||||
// // eslint-disable-next-line no-console
|
||||
// console.log('Status Page: Error with fetch', error);
|
||||
// return next();
|
||||
// }
|
||||
// });
|
||||
|
||||
app.use('/', async function(req, res, next) {
|
||||
const host = req.hostname;
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user