MCPcopy
hub / github.com/google/tamperchrome / getModifiedResponse

Function getModifiedResponse

v2/background/src/request.ts:82–99  ·  view source on GitHub ↗
(obj: Partial<InterceptedData>)

Source from the content-addressed store, hash-verified

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
102export class FetchIntercepted extends Intercepted {

Callers

nothing calls this directly

Calls 1

getResponseBodyMethod · 0.80

Tested by

no test coverage detected