more fixes
This commit is contained in:
parent
0e67374206
commit
2031e9dd7b
2 changed files with 9 additions and 3 deletions
10
src/index.ts
10
src/index.ts
|
@ -157,8 +157,14 @@ app.use("/uptime", (req: Request, res: Response) => {
|
||||||
app.use("/", async (req: Request, res: Response) => {
|
app.use("/", async (req: Request, res: Response) => {
|
||||||
const scheme = req.secure ? "https" : "http";
|
const scheme = req.secure ? "https" : "http";
|
||||||
const host = `${scheme}://${req.get("Host")}`;
|
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) {
|
if (host && ref) {
|
||||||
const link = `${host}/services/oembed?url=${encodeURIComponent(ref)}`;
|
const link = `${host}/services/oembed?url=${encodeURIComponent(ref)}`;
|
||||||
res.set(
|
res.set(
|
||||||
|
|
|
@ -115,7 +115,7 @@ export async function inviteResponse(
|
||||||
description,
|
description,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error processing invite response:", error);
|
//console.error("Error processing invite response:", error);
|
||||||
res.json({
|
res.json({
|
||||||
type: "link",
|
type: "link",
|
||||||
version: "1.0",
|
version: "1.0",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue