In the 'Handling client and server errors', the class HTTPResponseError constructor has to call 'super()' before accessing 'this.response'
Not doing this throws the following exception: "ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor"
Fix: This just changes the order so super(...) is first, then this.response...
MDN Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/super#using_super_in_classes
Mention the Host header in the default request headers table.
According to the standard [RFC 7230 Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing |https://httpwg.org/specs/rfc7230.html#header.host]
"A client MUST send a Host header field in all HTTP/1.1 request messages."
* body conversion and test
* also handle blobs
* typeof null is object
* test for blob also
* lowercase boundary are easier
* unreachable code, body should never be a blob or buffer any more.
* stream singleton
* use let
* typo
* convert blob stream into a whatwg stream
* lint fix
* update changelog
Co-authored-by: Antoni Kepinski <xxczaki@pm.me>
* fix: IPv6 literal parsing
* docs: Explain why search is overwritten
* test: Document the reason for square brackets
* docs: Mention basic auth support as a difference
* fix: Raise a TypeError when URL includes credentials
* Fix redirect failing when response is chunked but empty. #1220#1064
* Handle chunked responses where the final chunk and EOM code are in separate packets and where there is an additional data chunk in the same packet before the final chunk and EOM code.
* Use ESM import in runkit example file
* Update dependencies, version and transition to ESM
* Use ESM imports, add ESM-related info
* Remove rollup
* Lint TypeScript-related files
* Update dependency
* Lint & update dependency
* Lint
* Remove commonjs tests
* chore: update changelog
* Remove commonjs GitHub action
* Update funding.yml
* Update linter rules
* Lint
* Fix tsd
* Remove unnecessary types
* Simplify
* Use top-level await
* Update GitHub Actions
* Use Mocha with ESM
* Revamp
* specify what node version
* update formdata-node dep
* remove lint from example using top await
* updated name and link to formdata-polyfill
* Stop recommend form-data
* filter example - it has many duplicate variables
* Update type definitions to ESM
* Remove unused lint rule disable comment
* Remove leftover rollup and dist folder
* updated depn
* updated d.ts
* lint
* Fix breaking changes with blob v3 stream()
* revert eslint comment
* revert back to xo 0.39
Don't want to deal with all those new rules right now. will fix it later
fixed some of them...
* none TS fan trying to fix type definition
* Give me a break
* Test on all minimum supported Node.js versions (#1170)
* Test on all minimum supported Node.js versions
* Tweak Node.js workaround version range
* Handle Node.js 16 aborted error message
* fix node version string compare
Co-authored-by: Jimmy Wärting <jimmy@warting.se>
* bumped fetch-blob version
* import from dom lib
* rm unused comment
* updated required version in docs
* fixed named import
* set lowest support to 12.20.0
* comment explaining both
* rm log
Co-authored-by: Jimmy Wärting <jimmy@warting.se>
Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
* Improve Header's forEach method compliance with browser implementation.
* Replaced callback.call with Reflect.apply on Headers' forEach.
* Set undefined as default value for Header' forEach second argument.
* Rewrote test case where 'this' is undefined.
* Ignored lint issues (no-eq-null and eqeqeq).