MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / fetchData

Method fetchData

web/src/js/backends/websocket.tsx:111–121  ·  view source on GitHub ↗
(resource: Resource)

Source from the content-addressed store, hash-verified

109 }
110
111 fetchData(resource: Resource) {
112 const queue: Array<Action> = [];
113 this.activeFetches[resource] = queue;
114 return fetchApi(`./${resource}`)
115 .then((res) => res.json())
116 .then((json) => {
117 // Make sure that we are not superseded yet by the server sending a RESET.
118 if (this.activeFetches[resource] === queue)
119 this.receive(resource, json);
120 });
121 }
122
123 onMessage(msg: { type: WebsocketMessageType; payload?: any }) {
124 switch (msg.type) {

Callers 2

onOpenMethod · 0.95
onMessageMethod · 0.95

Calls 3

receiveMethod · 0.95
fetchApiFunction · 0.90
jsonMethod · 0.45

Tested by

no test coverage detected