(obj: Partial<InterceptedData>)
| 80 | } |
| 81 | |
| 82 | protected async getModifiedResponse(obj: Partial<InterceptedData>): Promise<Partial<InterceptedData>> { |
| 83 | let modified: Partial<InterceptedData> = {}; |
| 84 | if ( |
| 85 | (obj.status && obj.status != this.status) || |
| 86 | (JSON.stringify(obj.responseHeaders) != JSON.stringify(this.responseHeaders)) || |
| 87 | obj.responseBody |
| 88 | ) { |
| 89 | modified.status = obj.status; |
| 90 | modified.responseHeaders = obj.responseHeaders; |
| 91 | if (typeof obj.responseBody !== "undefined") { |
| 92 | modified.responseBody = obj.responseBody; |
| 93 | } else { |
| 94 | modified.responseBody = await this.getResponseBody(); |
| 95 | } |
| 96 | modified.responseBody = btoa(modified.responseBody || ''); |
| 97 | } |
| 98 | return modified; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | export class FetchIntercepted extends Intercepted { |
nothing calls this directly
no test coverage detected