File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -159,15 +159,17 @@ class TraceWrapper {
159159 const promise = new Promise ( ( resolver , reject ) => {
160160 responsePromise
161161 . then ( ( response ) => {
162- const clonedResponse = response . clone ( ) ;
163162 let responseBody ;
164- const contentType = clonedResponse . headers . get ( 'content-type' ) ;
163+ let clonedResponse ;
164+ const contentType = response . headers . get ( 'content-type' ) ;
165165 if ( contentType && contentType . indexOf ( 'application/json' ) !== - 1 ) {
166+ clonedResponse = response . clone ( ) ;
166167 clonedResponse . json ( ) . then ( ( data ) => {
167168 responseBody = data ;
168169 } ) ;
169170 }
170171 if ( contentType && contentType . indexOf ( 'text/plain;charset=UTF-8' ) !== - 1 ) {
172+ clonedResponse = response . clone ( ) ;
171173 clonedResponse . text ( ) . then ( ( data ) => {
172174 responseBody = data ;
173175 } ) ;
You can’t perform that action at this time.
0 commit comments