Commit Graph

576 Commits

Author SHA1 Message Date
Timothy Gu 1d4ab5a0de Switch to .mjs for ES module output for Node.js compat
This also reverts commit 60cf26c2f3.
2018-07-22 14:06:25 -07:00
Timothy Gu 6868e4aa59 Add __esModule property to exports object
Fixes: #442
2018-07-22 14:06:25 -07:00
Timothy Gu c01a5d22d4 Move .default assignment to plugins 2018-07-22 14:06:25 -07:00
Timothy Gu 6d7daa27c7
Migrate from mocha --compilers (#491) 2018-07-22 14:05:40 -07:00
Steven ecd82580aa Add badge to display install size (#455) 2018-07-22 13:34:32 -07:00
Timothy Gu de66b388ac
Update dependencies (#488) 2018-07-22 09:22:10 -07:00
Timothy Gu ed9e886cf3
Support web workers (#487)
Fixes: #485
2018-07-22 09:21:46 -07:00
Timothy Gu b091ab5917
Fix up ArrayBufferView support (#464)
Also add more test coverage.

Fixes: #482
Closes: #484
2018-07-21 22:13:01 -07:00
Bernhard K. Weisshuhn 287bc3bdcf test agent option `family` being passed to `lookup` 2018-06-19 12:52:13 -07:00
Bernhard K. Weisshuhn a33d6b0de1 mention agent options `family` and `lookup` in readme for reference 2018-06-19 12:52:13 -07:00
Bernhard K. Weisshuhn b2c5f543ce test supplying a lookup function through an agent 2018-06-19 12:52:13 -07:00
Timothy Gu 2b7e1ab27f Refine README example (#463)
This reverts commit fa6548ed31 (#441).

The autoClose option has been true by default since at least Node.js
v6.0.0. There is no need to set it once more.

Instead, make the example more realistic by handling stream outcomes
using a promise.

See #375.
2018-05-28 12:26:22 +08:00
Nazar Mokrynskyi 5bc23d81cf Added support for `ArrayBufferView` (#457) 2018-05-28 11:18:17 +08:00
Deepak fa6548ed31 fix: add the autoClose: true to download file example (#441)
close #375
2018-04-08 10:27:47 +08:00
Timothy Gu 989c8434a9
Uninstall encoding before first Travis test run
encoding can be included in the Travis CI cache, and thus needs to be
manually uninstalled first.
2018-03-25 18:59:21 -07:00
Timothy Gu 6b42bd68cb
Consolidate Travis CI matrix for encoding (#436)
See: #431
2018-03-25 14:56:37 -07:00
Timothy Gu bae5fdd306
Fix up CHANGELOG typo
[ci skip]
2018-03-25 14:09:14 -07:00
Timothy Gu b80c2f56a0
v2.1.2 2018-03-25 13:55:02 -07:00
Timothy Gu 1d51752ea3
Update CHANGELOG
[ci skip]
2018-03-25 13:54:48 -07:00
Timothy Gu f6683aa49c Add a test case for invalid headers
See feae6d6ec8.
2018-03-25 13:45:26 -07:00
Timothy Gu 13b230b30b Add a test for redirect with stream body
See 35722f19e5.
2018-03-25 13:45:26 -07:00
Timothy Gu aed2e69a39
Make sure to finalize the request properly (#432)
Unfortunately, I could not write a test case that allows testing the bug
in #428. Credits to Roman Zaharenkov <ZaharenkovRoman@gmail.com> for
discovering this long-standing bug and proposing a first version of the
fix.

Co-authored-by: Roman Zaharenkov <ZaharenkovRoman@gmail.com>
Fixes: #428
2018-03-24 20:50:33 -07:00
Mark Herhold d522036bee Bind fetch to window in the browser (#434) 2018-03-24 20:22:34 -07:00
Mark Herhold a1cbcb5706 Support TypeScript import in browser (#433) 2018-03-24 11:29:00 -07:00
Timothy Gu 8aac53679d
Fix custom Host header with arbitrary case (#430)
Regression since 1592ca1148.

Fixes: #416
Fixes: #425
2018-03-22 22:01:45 -07:00
Jason Rogers c012c4116b Reject when stream accumulation fails (#415)
Fixes: #414
2018-03-22 18:38:03 -07:00
William MacDonald 4c4f2f29e5 Wrap ArrayBuffer with Buffer internally to fix Body methods (#426) 2018-03-20 09:57:03 -07:00
Timothy Gu fb86ab34a6
v2.1.1 2018-03-04 20:44:09 -08:00
Timothy Gu 6a9828e0b5
Update CHANGELOG 2018-03-04 20:43:54 -08:00
Timothy Gu c7765c4498
Merge remote-tracking branch 'origin/master' 2018-03-04 20:42:55 -08:00
Timothy Gu ccaeae096f
v2.1.0 2018-03-04 20:41:56 -08:00
Timothy Gu 780598ad72
Harmonize style (#413) 2018-03-04 20:29:12 -08:00
Timothy Gu 119138ef64 Update existing algorithm step numbers 2018-03-04 20:25:16 -08:00
Timothy Gu 35722f19e5 Significant rework of redirection
- Handle Location-less redirect like non-redirect response.
- Include bodies when redirecting to non-POST 301/302 and all 307/308
  response.

Co-authored-by: Gregor Martynus <gregor@martynus.net>
2018-03-04 20:25:16 -08:00
Gregor Martynus fc539951ca Support ArrayBuffer as body (#408) 2018-03-04 16:40:39 -08:00
Timothy Gu feae6d6ec8
Ignore illegal HTTP headers
Fixes: #411
2018-03-04 13:12:36 -08:00
Timothy Gu 1592ca1148
Use caseless Headers handling
This is unfortunately impossible to test, since the Node.js HTTP library
lower-cases all incoming headers. However, this matters for outgoing
HTTP requests. See the linked issues from the linked Fetch Standard pull
request.

See: https://github.com/whatwg/fetch/pull/476
2018-03-04 13:03:48 -08:00
Timothy Gu a8f6d79c39
Simplify header validity check
See: nodejs/node@9f55eac346
See: nodejs/node@862389b0aa
2018-03-04 12:21:40 -08:00
Timothy Gu c0950b7b9f
v2.0.0 2018-02-03 12:34:24 -08:00
Timothy Gu 44c67b11a3
Add docs for v2.x 2018-02-03 12:33:32 -08:00
Timothy Gu b1cd2dd438
Better compliance with Web IDL
- Make read-only attributes actually read-only
- Set @@toStringTag on the prototype only
- Make prototype methods/getters enumerable

Based on #354.

Co-authored-by: Benjamin Seber <seber@synyx.de>
2018-02-03 12:12:14 -08:00
Timothy Gu dccef32e81
Refactor tests 2018-02-03 12:11:50 -08:00
Timothy Gu bc6f0da3ac
Remove Blob#close per spec change
See https://github.com/w3c/FileAPI/pull/68.
2018-02-03 11:19:32 -08:00
Timothy Gu 8c7c179fef
Add some more internal API docs 2018-02-03 11:19:32 -08:00
Timothy Gu 5774bf4229
Update dependencies 2018-02-03 11:19:31 -08:00
Moritz 19b115f9dc Add error event hander for the body stream even if the body isn't accessed (#379)
Fixes #378
2018-01-27 11:20:05 -08:00
David Frank a9c76c19ac
adding comment to recommend 2.x branch (#367) 2017-11-22 17:55:39 +08:00
David Frank 3345b652e4
fix a small oversight in request class
lowercase method name does not trigger type error properly (#362)
2017-11-19 12:44:02 +08:00
David Frank 6192398c46
Travis CI fix (#366)
* a quick test to see if we can drop npm install before script
* adding node 8 lts
2017-11-19 12:22:28 +08:00
David Frank d1a3b1ee34 2.0.0-alpha.9
* changelog update
2017-09-24 13:46:17 +08:00