2023-05-20 09:44:11 -07:00
|
|
|
exports.handler = async (event) => {
|
|
|
|
const { uri, querystring } = event?.Records?.[0]?.cf?.request || {};
|
|
|
|
|
|
|
|
const url = new URL(uri, `https://genderdysphoria.fyi`);
|
|
|
|
url.search = new URLSearchParams(querystring);
|
2023-02-19 12:59:03 -08:00
|
|
|
|
|
|
|
const body = `
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
2023-05-20 09:44:11 -07:00
|
|
|
<head><title>Gender Dysphoria Bible</title></head>
|
2023-02-19 12:59:03 -08:00
|
|
|
<body bgcolor="white">
|
2023-05-20 09:44:11 -07:00
|
|
|
<h1>Redirecting...</h1>
|
|
|
|
<a href="${url}">Click here if you are not redirected.</a>
|
2023-02-19 12:59:03 -08:00
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
`;
|
|
|
|
|
|
|
|
return {
|
|
|
|
status: '301',
|
|
|
|
statusDescription: `Redirecting to www domain`,
|
|
|
|
headers: {
|
2023-05-20 09:44:11 -07:00
|
|
|
location: [{
|
2023-02-19 12:59:03 -08:00
|
|
|
key: 'Location',
|
2023-05-20 09:44:11 -07:00
|
|
|
value: url.toString()
|
|
|
|
}],
|
2023-02-19 12:59:03 -08:00
|
|
|
},
|
2023-05-20 09:44:11 -07:00
|
|
|
body
|
2023-02-19 12:59:03 -08:00
|
|
|
};
|
|
|
|
};
|