fix: the url field is missing

This commit is contained in:
Acid Chicken (硫酸鶏) 2023-10-22 18:30:25 +09:00
parent 59d47aab0a
commit 2b2fe28b04
No known key found for this signature in database
GPG Key ID: 3E87B98A3F6BAB99
2 changed files with 2 additions and 0 deletions

View File

@ -25,6 +25,7 @@ app.get("/url", async (context) => {
return context.json({ error: "Invalid URL" }, 400);
}
const response = await fetch(url);
url = new URL(response.url);
const rewriter = new HTMLRewriter();
const summarized = summary(url, rewriter);
const reader = rewriter.transform(response).body!.getReader();

View File

@ -66,6 +66,7 @@ export default function general(url: URL, html: HTMLRewriter) {
sitename: siteName,
icon: favicon,
sensitive,
url: url.href,
};
}
);