Short circuit properly
This commit is contained in:
parent
4fe60f7c5d
commit
caa491736e
|
@ -28,7 +28,12 @@ export default async function Search(
|
|||
|
||||
c.header("content-type", ContentType(type))
|
||||
|
||||
const img = await fetch(imageURL, {headers: {"User-Agent": "waifurudorde/1.0.0 (+https://git.froth.zone/sam/waifurudor.de)"}})
|
||||
const img = await fetch(imageURL, {
|
||||
headers: {
|
||||
"User-Agent":
|
||||
"waifurudorde/1.0.0 (+https://git.froth.zone/sam/waifurudor.de)",
|
||||
},
|
||||
})
|
||||
// Turn the image into an ArrayBuffer
|
||||
.then((fetchRes) => {
|
||||
return fetchRes?.arrayBuffer()
|
||||
|
|
|
@ -28,9 +28,8 @@ app.get("/robots.txt", (c) => c.text("User-agent: *\nDisallow: /"))
|
|||
app.all("/", (c) => {
|
||||
const query: SearchQuery = {
|
||||
site: c.req.query("booru") ?? "safebooru",
|
||||
tags: c.req.query("tags") ?? c.req.header("Host") === "rint.osaka"
|
||||
? "tohsaka_rin"
|
||||
: "",
|
||||
tags: c.req.query("tags") ??
|
||||
(c.req.header("Host") === "rint.osaka" ? "tohsaka_rin" : ""),
|
||||
}
|
||||
customLogger(`Host: ${c.req.header("Host")}`)
|
||||
|
||||
|
|
Loading…
Reference in New Issue