MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / clone

Method clone

lib.commonjs/utils/fetch.js:560–586  ·  view source on GitHub ↗

* Create a new copy of this request.

()

Source from the content-addressed store, hash-verified

558 * Create a new copy of this request.
559 */
560 clone() {
561 const clone = new FetchRequest(this.url);
562 // Preserve "default method" (i.e. null)
563 clone.#method = this.#method;
564 // Preserve "default body" with type, copying the Uint8Array is present
565 if (this.#body) {
566 clone.#body = this.#body;
567 }
568 clone.#bodyType = this.#bodyType;
569 // Preserve "default headers"
570 clone.#headers = Object.assign({}, this.#headers);
571 // Credentials is readonly, so we copy internally
572 clone.#creds = this.#creds;
573 if (this.allowGzip) {
574 clone.allowGzip = true;
575 }
576 clone.timeout = this.timeout;
577 if (this.allowInsecureAuthentication) {
578 clone.allowInsecureAuthentication = true;
579 }
580 clone.#preflight = this.#preflight;
581 clone.#process = this.#process;
582 clone.#retry = this.#retry;
583 clone.#throttle = Object.assign({}, this.#throttle);
584 clone.#getUrlFunc = this.#getUrlFunc;
585 return clone;
586 }
587 /**
588 * Locks all static configuration for gateways and FetchGetUrlFunc
589 * registration.

Callers 2

#sendMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected