-
-
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
18 changed files
with
1,125 additions
and
423 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,54 @@ | ||
--- | ||
'@whatwg-node/node-fetch': patch | ||
--- | ||
|
||
- Normalization fixes on `URL` | ||
|
||
Normalize the URL if it has a port and query string without a pathname; | ||
|
||
```diff | ||
+ http://example.com:80?query | ||
- http://example.com:80/?query | ||
``` | ||
|
||
Previously, it was normalized like below which was incorrect; | ||
|
||
```diff | ||
- http://example.com:80?query | ||
+ http://example.com/:80?query | ||
``` | ||
|
||
- Fix `URL.origin` | ||
|
||
When the URL has a port, `origin` was doubling the port number; | ||
|
||
```diff | ||
- http://example.com:80:80 | ||
+ http://example.com:80 | ||
``` | ||
|
||
- Fix `ReadableStream[Symbol.asyncIterator]` | ||
|
||
`ReadableStream` uses `Readable` so it uses `Symbol.asyncIterator` method of `Readable` but the returned iterator's `.return` method doesn't handle cancellation correctly. So we need to call `readable.destroy(optionalError)` manually to cancel the stream. | ||
|
||
This allows `ReadableStream` to use implementations relying on `AsyncIterable.cancel` to handle cancellation like `Readable.from` | ||
|
||
Previously the following was not handling cancellation; | ||
|
||
```ts | ||
const res = new ReadableStream({ | ||
start(controller) { | ||
controller.enqueue('Hello'); | ||
controller.enqueue('World'); | ||
}, | ||
cancel(reason) { | ||
console.log('cancelled', reason); | ||
} | ||
}); | ||
|
||
const readable = Readable.from(res); | ||
|
||
readable.destroy(new Error('MY REASON')); | ||
|
||
// Should log 'cancelled MY REASON' | ||
``` |
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ on: | |
|
||
env: | ||
NODE_OPTIONS: --max-old-space-size=4096 | ||
NODE_NO_WARNINGS: 1 | ||
CI: true | ||
|
||
jobs: | ||
|
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 @@ | ||
ignore-engines true |
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.