File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -90,12 +90,13 @@ export class HttpBody implements MessageBody {
9090 // definitively unlinked, since some browser issues can result in exchanges not GCing immediately.
9191 // Important: for safety, this leaves the body in a *VALID* but reset state - not a totally blank one.
9292 cleanup ( ) {
93- const emptyBuffer = Buffer . from ( [ ] ) ;
94-
9593 // Set to a valid state for an un-decoded but totally empty body.
9694 this . _decoded = undefined ;
97- this . _encoded = emptyBuffer ;
95+ this . _encoded = EMPTY_BUFFER ;
9896 this . decodingError = undefined ;
99- this . decodedPromise = observablePromise ( Promise . resolve ( emptyBuffer ) ) ;
97+ this . decodedPromise = PROMISE_FOR_EMPTY_BUFFER ;
10098 }
101- }
99+ }
100+
101+ const EMPTY_BUFFER = Buffer . from ( [ ] ) ;
102+ const PROMISE_FOR_EMPTY_BUFFER = observablePromise ( Promise . resolve ( EMPTY_BUFFER ) ) ;
You can’t perform that action at this time.
0 commit comments