()
| 13553 | `'${request.method} is unsupported in no-cors mode.` |
| 13554 | ); |
| 13555 | } |
| 13556 | setHeadersGuard(this[kHeaders], "request-no-cors"); |
| 13557 | } |
| 13558 | if (initHasKey) { |
| 13559 | const headersList = getHeadersList(this[kHeaders]); |
| 13560 | const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); |
| 13561 | headersList.clear(); |
| 13562 | if (headers instanceof HeadersList) { |
| 13563 | for (const { name, value } of headers.rawValues()) { |
| 13564 | headersList.append(name, value, false); |
| 13565 | } |
| 13566 | headersList.cookies = headers.cookies; |
| 13567 | } else { |
| 13568 | fillHeaders(this[kHeaders], headers); |
| 13569 | } |
| 13570 | } |
| 13571 | const inputBody = input instanceof _Request ? input[kState].body : null; |
| 13572 | if ((init.body != null || inputBody != null) && (request.method === "GET" || request.method === "HEAD")) { |
| 13573 | throw new TypeError("Request with GET/HEAD method cannot have body."); |
| 13574 | } |
| 13575 | let initBody = null; |
| 13576 | if (init.body != null) { |
| 13577 | const [extractedBody, contentType] = extractBody( |
| 13578 | init.body, |
| 13579 | request.keepalive |
| 13580 | ); |
| 13581 | initBody = extractedBody; |
no test coverage detected