-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@whatwg-node/node-fetch': patch | ||
--- | ||
|
||
Fix the error thrown \`ENOTFOUND\` when a parsed URL with IPV6 hostname is given | ||
|
||
Instead of using the parsed URL passed to the `fetch` function, let `node:http` parse it again. This way, the IPV6 hostname is correctly resolved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
'@whatwg-node/node-fetch': patch | ||
--- | ||
|
||
`url.searchParams` parameter should reflect the changes in `toString()` | ||
|
||
```ts | ||
const url = new URL('http://example.com/?a=b'); | ||
url.searchParams.set('a', 'c'); | ||
console.log(url.toString()); // http://example.com/?a=c | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
'@whatwg-node/server': patch | ||
--- | ||
|
||
Wait for remaining promises during `asyncDispose` correctly | ||
|
||
The `asyncDispose` function should wait for all remaining promises to resolve before returning. This ensures that the server is fully disposed of before the function returns. | ||
|
||
```ts | ||
import { createServerAdapter } from '@whatwg-node/server'; | ||
|
||
const deferred = Promise.withResolvers(); | ||
|
||
const adapter = createServerAdapter((req, ctx) => { | ||
ctx.waitUntil(deferred.promise); | ||
return new Response('Hello, world!'); | ||
}); | ||
|
||
const res = await adapter.fetch('http://example.com'); | ||
console.assert(res.status === 200); | ||
console.assert(await res.text() === 'Hello, world!'); | ||
|
||
let disposed = false; | ||
adapter[Symbol.asyncDispose]().then(() => { | ||
disposed = true; | ||
}); | ||
|
||
console.assert(!disposed); | ||
|
||
deferred.resolve(); | ||
|
||
console.assert(disposed); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@whatwg-node/node-fetch': patch | ||
--- | ||
|
||
Fix IPV6 parsing in \`URL\`; | ||
|
||
`new URL('http://[::1]')` should parse the host as \`[::1]\` not \`::1\`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters