MCPcopy Create free account
hub / github.com/4as/Chat-DeMod / cloneRequest

Function cloneRequest

Chat DeMod.user.js:187–203  ·  view source on GitHub ↗
(request, fetch_url, method, body)

Source from the content-addressed store, hash-verified

185 }
186
187 function cloneRequest(request, fetch_url, method, body) {
188 var options = {
189 method: method,
190 headers: request.headers,
191 referrer: request.referrer,
192 referrerPolicy: request.referrerPolicy,
193 mode: request.mode,
194 credentials: request.credentials,
195 cache: request.cache,
196 redirect: request.redirect,
197 integrity: request.integrity,
198 };
199 if( body !== null && method !== "GET" && method !== "HEAD" ) {
200 options.body = JSON.stringify(body);
201 }
202 return new Request(fetch_url, options);
203 }
204
205 function cloneEvent(event, new_data) {
206 return new MessageEvent('message', {

Callers 2

redownloadLatestFunction · 0.85
intercepter_fetchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected