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