chore: fix type errors caused by canary (#3477)

This commit is contained in:
Yoshiya Hinosawa 2023-07-04 13:57:05 +09:00 committed by GitHub
parent 7cdd55a083
commit 2acd2bb2fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -15,4 +15,5 @@ extend-exclude = [
"*.generated.mjs",
"media_types/vendor",
"http/testdata",
"http/user_agent.ts"
]

View File

@ -130,7 +130,7 @@ async function fetchExactPath(
const encoder = new TextEncoder();
const decoder = new TextDecoder();
const request = encoder.encode("GET " + path + " HTTP/1.1\r\n\r\n");
let conn: void | Deno.Conn;
let conn: undefined | Deno.Conn;
try {
conn = await Deno.connect(
{ hostname: hostname, port: port, transport: "tcp" },

View File

@ -345,10 +345,11 @@ export class ServerSentEventStreamTarget extends EventTarget
* {@linkcode ResponseInit} needed to create a response that will establish
* a SSE connection with the client. */
asResponseInit(responseInit: ResponseInit = {}): [BodyInit, ResponseInit] {
responseInit.headers = new Headers(responseInit.headers);
const headers = new Headers(responseInit.headers);
for (const [key, value] of RESPONSE_HEADERS) {
responseInit.headers.set(key, value);
headers.set(key, value);
}
responseInit.headers = headers;
return [this.#bodyInit, responseInit];
}