You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CHANGELOG.md 5.2 KiB

3 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. Changelog
  2. =========
  3. # 1.x release
  4. (Note: `1.x` will only have backported bugfix releases beyond `1.7.0`)
  5. ## v1.7.3
  6. - Enhance: `FetchError` now gives a correct trace stack (backport from v2.x relese).
  7. ## v1.7.2
  8. - Fix: when using node-fetch with test framework such as `jest`, `instanceof` check could fail in `Headers` class. This is causing some header values, such as `set-cookie`, to be dropped incorrectly.
  9. ## v1.7.1
  10. - Fix: close local test server properly under Node 8.
  11. ## v1.7.0
  12. - Fix: revert change in `v1.6.2` where 204 no-content response is handled with a special case, this conflicts with browser Fetch implementation (as browsers always throw when res.json() parses an empty string). Since this is an operational error, it's wrapped in a `FetchError` for easier error handling.
  13. - Fix: move code coverage tool to codecov platform and update travis config
  14. ## v1.6.3
  15. - Enhance: error handling document to explain `FetchError` design
  16. - Fix: support `form-data` 2.x releases (requires `form-data` >= 2.1.0)
  17. ## v1.6.2
  18. - Enhance: minor document update
  19. - Fix: response.json() returns empty object on 204 no-content response instead of throwing a syntax error
  20. ## v1.6.1
  21. - Fix: if `res.body` is a non-stream non-formdata object, we will call `body.toString` and send it as a string
  22. - Fix: `counter` value is incorrectly set to `follow` value when wrapping Request instance
  23. - Fix: documentation update
  24. ## v1.6.0
  25. - Enhance: added `res.buffer()` api for convenience, it returns body as a Node.js buffer
  26. - Enhance: better old server support by handling raw deflate response
  27. - Enhance: skip encoding detection for non-HTML/XML response
  28. - Enhance: minor document update
  29. - Fix: HEAD request doesn't need decompression, as body is empty
  30. - Fix: `req.body` now accepts a Node.js buffer
  31. ## v1.5.3
  32. - Fix: handle 204 and 304 responses when body is empty but content-encoding is gzip/deflate
  33. - Fix: allow resolving response and cloned response in any order
  34. - Fix: avoid setting `content-length` when `form-data` body use streams
  35. - Fix: send DELETE request with content-length when body is present
  36. - Fix: allow any url when calling new Request, but still reject non-http(s) url in fetch
  37. ## v1.5.2
  38. - Fix: allow node.js core to handle keep-alive connection pool when passing a custom agent
  39. ## v1.5.1
  40. - Fix: redirect mode `manual` should work even when there is no redirection or broken redirection
  41. ## v1.5.0
  42. - Enhance: rejected promise now use custom `Error` (thx to @pekeler)
  43. - Enhance: `FetchError` contains `err.type` and `err.code`, allows for better error handling (thx to @pekeler)
  44. - Enhance: basic support for redirect mode `manual` and `error`, allows for location header extraction (thx to @jimmywarting for the initial PR)
  45. ## v1.4.1
  46. - Fix: wrapping Request instance with FormData body again should preserve the body as-is
  47. ## v1.4.0
  48. - Enhance: Request and Response now have `clone` method (thx to @kirill-konshin for the initial PR)
  49. - Enhance: Request and Response now have proper string and buffer body support (thx to @kirill-konshin)
  50. - Enhance: Body constructor has been refactored out (thx to @kirill-konshin)
  51. - Enhance: Headers now has `forEach` method (thx to @tricoder42)
  52. - Enhance: back to 100% code coverage
  53. - Fix: better form-data support (thx to @item4)
  54. - Fix: better character encoding detection under chunked encoding (thx to @dsuket for the initial PR)
  55. ## v1.3.3
  56. - Fix: make sure `Content-Length` header is set when body is string for POST/PUT/PATCH requests
  57. - Fix: handle body stream error, for cases such as incorrect `Content-Encoding` header
  58. - Fix: when following certain redirects, use `GET` on subsequent request per Fetch Spec
  59. - Fix: `Request` and `Response` constructors now parse headers input using `Headers`
  60. ## v1.3.2
  61. - Enhance: allow auto detect of form-data input (no `FormData` spec on node.js, this is form-data specific feature)
  62. ## v1.3.1
  63. - Enhance: allow custom host header to be set (server-side only feature, as it's a forbidden header on client-side)
  64. ## v1.3.0
  65. - Enhance: now `fetch.Request` is exposed as well
  66. ## v1.2.1
  67. - Enhance: `Headers` now normalized `Number` value to `String`, prevent common mistakes
  68. ## v1.2.0
  69. - Enhance: now fetch.Headers and fetch.Response are exposed, making testing easier
  70. ## v1.1.2
  71. - Fix: `Headers` should only support `String` and `Array` properties, and ignore others
  72. ## v1.1.1
  73. - Enhance: now req.headers accept both plain object and `Headers` instance
  74. ## v1.1.0
  75. - Enhance: timeout now also applies to response body (in case of slow response)
  76. - Fix: timeout is now cleared properly when fetch is done/has failed
  77. ## v1.0.6
  78. - Fix: less greedy content-type charset matching
  79. ## v1.0.5
  80. - Fix: when `follow = 0`, fetch should not follow redirect
  81. - Enhance: update tests for better coverage
  82. - Enhance: code formatting
  83. - Enhance: clean up doc
  84. ## v1.0.4
  85. - Enhance: test iojs support
  86. - Enhance: timeout attached to socket event only fire once per redirect
  87. ## v1.0.3
  88. - Fix: response size limit should reject large chunk
  89. - Enhance: added character encoding detection for xml, such as rss/atom feed (encoding in DTD)
  90. ## v1.0.2
  91. - Fix: added res.ok per spec change
  92. ## v1.0.0
  93. - Enhance: better test coverage and doc
  94. # 0.x release
  95. ## v0.1
  96. - Major: initial public release