File tree 1 file changed +6
-5
lines changed
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 {
90
90
// definitively unlinked, since some browser issues can result in exchanges not GCing immediately.
91
91
// Important: for safety, this leaves the body in a *VALID* but reset state - not a totally blank one.
92
92
cleanup ( ) {
93
- const emptyBuffer = Buffer . from ( [ ] ) ;
94
-
95
93
// Set to a valid state for an un-decoded but totally empty body.
96
94
this . _decoded = undefined ;
97
- this . _encoded = emptyBuffer ;
95
+ this . _encoded = EMPTY_BUFFER ;
98
96
this . decodingError = undefined ;
99
- this . decodedPromise = observablePromise ( Promise . resolve ( emptyBuffer ) ) ;
97
+ this . decodedPromise = PROMISE_FOR_EMPTY_BUFFER ;
100
98
}
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