fix(api): 🐛 Correctly return empty body without content-type headers, when returning empty responses

This commit is contained in:
Jesse Wierzbinski 2024-12-07 12:20:06 +01:00
parent 2743528727
commit 06376cf58a
No known key found for this signature in database
15 changed files with 18 additions and 18 deletions

View file

@ -33,7 +33,7 @@ export const bait = createMiddleware(async (context, next) => {
if (requestIp?.address) {
for (const ip of config.http.bait.bait_ips) {
if (matches(ip, requestIp.address)) {
return context.newResponse(file.stream());
return context.body(file.stream());
}
}
}
@ -43,7 +43,7 @@ export const bait = createMiddleware(async (context, next) => {
for (const agent of config.http.bait.bait_user_agents) {
if (new RegExp(agent).test(ua)) {
return context.newResponse(file.stream());
return context.body(file.stream());
}
}