192 Commits (cache-clone-stream)

Author SHA1 Message Date
Luke Childs 0edfb324d9 Cone stream so we can do stuff with it at different times 8 years ago
Luke Childs e328719d17 Add `fromCache` property to response object 8 years ago
Luke Childs 1843cbaf48 Pass TTL to cache 8 years ago
Luke Childs b63a641245 Delete stale cache entries that can't be revalidated 8 years ago
Luke Childs 07a403c152 Revalidate stale cached responses that have Last-Modified/ETag headers. 8 years ago
Luke Childs f6f915bae3 No point doing caching inside a function now it's only used once 8 years ago
Luke Childs 75a999545a Include stream processing inside cache function 8 years ago
Luke Childs 6212f165ee Move caching logic back into get() 8 years ago
Luke Childs 23d76e3fae Don't redo what getStream already does 8 years ago
Luke Childs 159c3994a8 Use pipe instead of manually piping inside data 8 years ago
Luke Childs d4cf24c421 Don't save buffer encoding, it's not needed 8 years ago
Luke Childs dbb7f206e5 Cache stream responses 8 years ago
Luke Childs 838821d5a5 Rafactor caching into external function and only read stream once 8 years ago
Luke Childs a31c966e23 Store body data encoding so we can reliably convert to buffer 8 years ago
Luke Childs e4ae2c68b9 Don't serialize cache object to JSON 8 years ago
Luke Childs 39811aa860 Object destructuring on single line 8 years ago
Luke Childs b8b341166d Don't store stream in unnecessary variable 8 years ago
Luke Childs 903fbfaa84 Store status code and url in cache. Don't store headers. 8 years ago
Luke Childs b0490ca4a3 Simplify cache option check 8 years ago
Luke Childs b65128e113 Move cache read logic into separate function 8 years ago
Luke Childs 817de11b72 opts.cache API should match Map() API 8 years ago
Luke Childs 5ec945f527 Allow opts.cache.get to return value or Promise 8 years ago
Luke Childs 011ea0e50c Include method in cache key 8 years ago
Luke Childs 0d6180a279 If we retrieve a stale cache entry, delete it immediately 8 years ago
Luke Childs 0f6f944b9e Drop expired for http-cache-semantics 8 years ago
Luke Childs 49b6f00763 Return cached response immediately if not stale 8 years ago
Luke Childs 43023d5818 Optional response caching 8 years ago
Luke Childs 7b12b7582d Don't throw HTTPError on 304 responses (#252) 8 years ago
Alexander Tesfamichael a287f8ec8a Add url to errors (#286) 8 years ago
Sindre Sorhus 1f1b6ffb6d Bump dependencies and fix lint issues 8 years ago
Alexander Tesfamichael 919703cd8e Add protocol to stdError (#277) 8 years ago
Vsevolod Strukchinsky 52ddf95efc rename timeout option before passign to http.request 8 years ago
Dmitry Tsvettsikh 53b11e3539 use `safe-buffer` (#253) 8 years ago
Sindre Sorhus 98aa20682d drop the `node-status-code` dependency 8 years ago
Sindre Sorhus e1ca864d9e minor cleanup 8 years ago
Tommy Troy Lin 3b8665cec9 fix TypeError: binary is not a function (#243) 8 years ago
Vsevolod Strukchinsky 984cd7943c fix url and responseUrl properties on gzip'ed response 8 years ago
Kevin Mårtensson 7e8af3362b Add `url` to response (#236) 8 years ago
Kevin Martensson 5888ca7aa1 `new Buffer()` => `Buffer.from()` 8 years ago
Kevin Mårtensson 205e224bcd Add `requestUrl` to response in streaming mode (#230) 8 years ago
Sindre Sorhus f616a0fced make XO happy 8 years ago
bisubus 21b8b4a5bf allow non-plain object as request body (#217) 9 years ago
Dylan Piercey 57f13d9af2 Detect formdata body and set content-type header (#220) 9 years ago
Luan Muniz 9185b5beb0 Fix location encoding (#214) 9 years ago
Luan Muniz 1409f828fe Add a `requestUrl` property to the response object (#205) 9 years ago
Roland Warmerdam 52a67e60a1 Add redirect url to response object (#191) 9 years ago
Sindre Sorhus 9bb4696c16 fix lint issues with latest XO 9 years ago
Sindre Sorhus 7ad5e0efc2 fix failing test caused by changes in `prepend-http` module 9 years ago
Sindre Sorhus f33514146c minor tweaks 9 years ago
Ruy Adorno b3cd961254 Added option to toggle automatic following redirects 9 years ago