1
0
Fork 0
Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2024-03-23 17:43:29 +01:00
parent 69c250e5f2
commit 4e584f8de0
Signed by: sam
GPG Key ID: 4D8B07C18F31ACBD
1 changed files with 2 additions and 1 deletions

View File

@ -21,12 +21,13 @@ export default async function Search(
const imageURL = (posts as booru.SearchResults)[0]?.fileUrl as string
const type = imageURL?.split(".")?.pop() as string
const type = imageURL?.split(".")?.pop()
if (type == null) {
return c.json({ error: "No results found" }, 404)
}
c.header("content-type", ContentType(type))
c.header("Access-Control-Allow-Origin", "*")
const img = await fetch(imageURL, {
headers: {