1# Change Log 2 3All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 5<a name="2.0.2"></a> 6## [2.0.2](https://github.com/npm/node-fetch-npm/compare/v2.0.1...v2.0.2) (2017-08-15) 7 8 9### Bug Fixes 10 11* **json:** replace jju with a custom syntax error reporter ([#6](https://github.com/npm/node-fetch-npm/issues/6)) ([84d169c](https://github.com/npm/node-fetch-npm/commit/84d169c)) 12 13 14 15<a name="2.0.1"></a> 16## [2.0.1](https://github.com/npm/node-fetch-npm/compare/v2.0.0...v2.0.1) (2017-05-24) 17 18 19### Bug Fixes 20 21* **json:** improve JSON parse error reporting ([1c810df](https://github.com/npm/node-fetch-npm/commit/1c810df)) 22 23 24 25<a name="2.0.0"></a> 26# [2.0.0](https://github.com/npm/node-fetch-npm/compare/v1.0.1...v2.0.0) (2017-05-06) 27 28 29### Features 30 31* **version:** force bump to 2.0 ([39c5d50](https://github.com/npm/node-fetch-npm/commit/39c5d50)) 32 33 34### BREAKING CHANGES 35 36* **version:** tooling got confused, so hitting 2.0.0 for reals now 37 38 39 40<a name="1.0.1"></a> 41## [1.0.1](https://github.com/npm/node-fetch-npm/compare/v1.0.0...v1.0.1) (2017-05-06) 42 43 44### Bug Fixes 45 46* **redirect:** Remove authorization header on redirect to different host ([#2](https://github.com/npm/node-fetch-npm/issues/2)) ([273260e](https://github.com/npm/node-fetch-npm/commit/273260e)) 47 48 49 50<a name="1.0.0"></a> 51# [1.0.0](https://github.com/npm/node-fetch-npm/compare/v2.0.0-alpha.3...v1.0.0) (2017-04-26) 52 53 54### Bug Fixes 55 56* **proj:** initial fork changes ([0a190a8](https://github.com/npm/node-fetch-npm/commit/0a190a8)) 57 58 59### BREAKING CHANGES 60 61* **proj:** this renames the library altogether 62 63 64 65 66Changelog 67========= 68 69 70# 2.x release 71 72## v2.0.0 73 74This is a major release. Check [our upgrade guide](https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md) for an overview on some key differences between v1 and v2. 75 76### General changes 77 78- Major: Node.js 0.10.x and 0.12.x support is dropped 79- Major: `require('node-fetch/lib/response')` etc. is now unsupported; use `require('node-fetch').Response` or ES6 module imports 80- Enhance: start testing on Node.js 4, 6, 7 81- Enhance: use Rollup to produce a distributed bundle (less memory overhead and faster startup) 82- Enhance: make `Object.prototype.toString()` on Headers, Requests, and Responses return correct class strings 83- Other: rewrite in ES2015 using Babel 84- Other: use Codecov for code coverage tracking 85 86### HTTP requests 87 88- Major: overwrite user's `Content-Length` if we can be sure our information is correct (per spec) 89- Fix: support WHATWG URL objects, created by `whatwg-url` package or `require('url').URL` in Node.js 7+ 90 91### Response and Request classes 92 93- Major: `response.text()` no longer attempts to detect encoding, instead always opting for UTF-8 (per spec); use `response.textConverted()` for the v1 behavior 94- Major: make `response.json()` throw error instead of returning an empty object on 204 no-content respose (per spec; reverts behavior changed in v1.6.2) 95- Major: internal methods are no longer exposed 96- Major: throw error when a `GET` or `HEAD` Request is constructed with a non-null body (per spec) 97- Enhance: add `response.arrayBuffer()` (also applies to Requests) 98- Enhance: add experimental `response.blob()` (also applies to Requests) 99- Fix: fix Request and Response with `null` body 100 101### Headers class 102 103- Major: remove `headers.getAll()`; make `get()` return all headers delimited by commas (per spec) 104- Enhance: make Headers iterable 105- Enhance: make Headers constructor accept an array of tuples 106- Enhance: make sure header names and values are valid in HTTP 107- Fix: coerce Headers prototype function parameters to strings, where applicable 108 109### Documentation 110 111- Enhance: more comprehensive API docs 112- Enhance: add a list of default headers in README 113 114 115# 1.x release 116 117## v1.6.3 118 119- Enhance: error handling document to explain `FetchError` design 120- Fix: support `form-data` 2.x releases (requires `form-data` >= 2.1.0) 121 122## v1.6.2 123 124- Enhance: minor document update 125- Fix: response.json() returns empty object on 204 no-content response instead of throwing a syntax error 126 127## v1.6.1 128 129- Fix: if `res.body` is a non-stream non-formdata object, we will call `body.toString` and send it as a string 130- Fix: `counter` value is incorrectly set to `follow` value when wrapping Request instance 131- Fix: documentation update 132 133## v1.6.0 134 135- Enhance: added `res.buffer()` api for convenience, it returns body as a Node.js buffer 136- Enhance: better old server support by handling raw deflate response 137- Enhance: skip encoding detection for non-HTML/XML response 138- Enhance: minor document update 139- Fix: HEAD request doesn't need decompression, as body is empty 140- Fix: `req.body` now accepts a Node.js buffer 141 142## v1.5.3 143 144- Fix: handle 204 and 304 responses when body is empty but content-encoding is gzip/deflate 145- Fix: allow resolving response and cloned response in any order 146- Fix: avoid setting `content-length` when `form-data` body use streams 147- Fix: send DELETE request with content-length when body is present 148- Fix: allow any url when calling new Request, but still reject non-http(s) url in fetch 149 150## v1.5.2 151 152- Fix: allow node.js core to handle keep-alive connection pool when passing a custom agent 153 154## v1.5.1 155 156- Fix: redirect mode `manual` should work even when there is no redirection or broken redirection 157 158## v1.5.0 159 160- Enhance: rejected promise now use custom `Error` (thx to @pekeler) 161- Enhance: `FetchError` contains `err.type` and `err.code`, allows for better error handling (thx to @pekeler) 162- Enhance: basic support for redirect mode `manual` and `error`, allows for location header extraction (thx to @jimmywarting for the initial PR) 163 164## v1.4.1 165 166- Fix: wrapping Request instance with FormData body again should preserve the body as-is 167 168## v1.4.0 169 170- Enhance: Request and Response now have `clone` method (thx to @kirill-konshin for the initial PR) 171- Enhance: Request and Response now have proper string and buffer body support (thx to @kirill-konshin) 172- Enhance: Body constructor has been refactored out (thx to @kirill-konshin) 173- Enhance: Headers now has `forEach` method (thx to @tricoder42) 174- Enhance: back to 100% code coverage 175- Fix: better form-data support (thx to @item4) 176- Fix: better character encoding detection under chunked encoding (thx to @dsuket for the initial PR) 177 178## v1.3.3 179 180- Fix: make sure `Content-Length` header is set when body is string for POST/PUT/PATCH requests 181- Fix: handle body stream error, for cases such as incorrect `Content-Encoding` header 182- Fix: when following certain redirects, use `GET` on subsequent request per Fetch Spec 183- Fix: `Request` and `Response` constructors now parse headers input using `Headers` 184 185## v1.3.2 186 187- Enhance: allow auto detect of form-data input (no `FormData` spec on node.js, this is form-data specific feature) 188 189## v1.3.1 190 191- Enhance: allow custom host header to be set (server-side only feature, as it's a forbidden header on client-side) 192 193## v1.3.0 194 195- Enhance: now `fetch.Request` is exposed as well 196 197## v1.2.1 198 199- Enhance: `Headers` now normalized `Number` value to `String`, prevent common mistakes 200 201## v1.2.0 202 203- Enhance: now fetch.Headers and fetch.Response are exposed, making testing easier 204 205## v1.1.2 206 207- Fix: `Headers` should only support `String` and `Array` properties, and ignore others 208 209## v1.1.1 210 211- Enhance: now req.headers accept both plain object and `Headers` instance 212 213## v1.1.0 214 215- Enhance: timeout now also applies to response body (in case of slow response) 216- Fix: timeout is now cleared properly when fetch is done/has failed 217 218## v1.0.6 219 220- Fix: less greedy content-type charset matching 221 222## v1.0.5 223 224- Fix: when `follow = 0`, fetch should not follow redirect 225- Enhance: update tests for better coverage 226- Enhance: code formatting 227- Enhance: clean up doc 228 229## v1.0.4 230 231- Enhance: test iojs support 232- Enhance: timeout attached to socket event only fire once per redirect 233 234## v1.0.3 235 236- Fix: response size limit should reject large chunk 237- Enhance: added character encoding detection for xml, such as rss/atom feed (encoding in DTD) 238 239## v1.0.2 240 241- Fix: added res.ok per spec change 242 243## v1.0.0 244 245- Enhance: better test coverage and doc 246 247 248# 0.x release 249 250## v0.1 251 252- Major: initial public release 253