more fixes

This commit is contained in:
MathMan05 2024-12-26 13:03:38 -06:00
parent 0e67374206
commit 2031e9dd7b
2 changed files with 9 additions and 3 deletions

View file

@ -157,8 +157,14 @@ app.use("/uptime", (req: Request, res: Response) => {
app.use("/", async (req: Request, res: Response) => {
const scheme = req.secure ? "https" : "http";
const host = `${scheme}://${req.get("Host")}`;
const ref = host + req.originalUrl;
let ref = host + req.originalUrl;
if (Object.keys(req.query).length !== 0) {
const parms = new URLSearchParams();
for (const key of Object.keys(req.query)) {
parms.set(key, req.query[key] as string);
}
ref + `?${parms}`;
}
if (host && ref) {
const link = `${host}/services/oembed?url=${encodeURIComponent(ref)}`;
res.set(

View file

@ -115,7 +115,7 @@ export async function inviteResponse(
description,
});
} catch (error) {
console.error("Error processing invite response:", error);
//console.error("Error processing invite response:", error);
res.json({
type: "link",
version: "1.0",