mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
fix(api): 🐛 Correctly return empty body without content-type headers, when returning empty responses
This commit is contained in:
parent
2743528727
commit
06376cf58a
15 changed files with 18 additions and 18 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue