Properly dispose of unused undici HTTP responses (#3344)
Properly dispose of unused http responses
This commit is contained in:
parent
9dc7251fc7
commit
48a0e9d606
6
.changeset/afraid-peas-tan.md
Normal file
6
.changeset/afraid-peas-tan.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
"@atproto/dev-env": patch
|
||||
"@atproto/ozone": patch
|
||||
---
|
||||
|
||||
Properly dispose of unused http responses
|
@ -45,7 +45,7 @@ export const mockResolvers = (idResolver: IdResolver, pds: TestPds) => {
|
||||
try {
|
||||
const res = await request(url, { headers: { host: handle } })
|
||||
if (res.statusCode !== 200) {
|
||||
res.body.destroy()
|
||||
await res.body.dump()
|
||||
return undefined
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ export class BlobDiverter {
|
||||
})
|
||||
|
||||
if (blobResponse.statusCode !== 200) {
|
||||
blobResponse.body.destroy()
|
||||
await blobResponse.body.dump()
|
||||
throw new XRPCError(
|
||||
blobResponse.statusCode,
|
||||
undefined,
|
||||
@ -72,7 +72,7 @@ export class BlobDiverter {
|
||||
}
|
||||
} catch (err) {
|
||||
// Typically un-supported content encoding
|
||||
blobResponse.body.destroy()
|
||||
await blobResponse.body.dump()
|
||||
throw err
|
||||
}
|
||||
}
|
||||
@ -99,7 +99,7 @@ export class BlobDiverter {
|
||||
})
|
||||
|
||||
if (result.statusCode !== 200) {
|
||||
result.body.destroy()
|
||||
await result.body.dump()
|
||||
throw new XRPCError(
|
||||
result.statusCode,
|
||||
undefined,
|
||||
|
Loading…
x
Reference in New Issue
Block a user