* convert some test to async/await
* Update main.js
* use await
Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
* take back should accept custom HoSt header
* remove trailing space
Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
* Handle zero-length OK deflate responses
* Also handle pump callback in the deflate branch
* Update the use of pump everywhere and link to the original PR
* Address lints
* Add a warning when using .data in RequestInit
* Add a warning when using .data in Response
* Switch custom solution for utils.deprecate
* Remove unused line in request tests
* moved error handler into the body class
* lint fix
Co-authored-by: Lubomir <lubomir.yudenko@gmail.com>
* remove unused file
* two test is coveraged by the Uint8Array test
* use arrayBuffer to test base64 instead
* avoid testing buffer
* avoid using Buffer
* import buffer module
* use one same textEncoder
* import stream consumer that can test iterable objects
* fix a test
* fix test where type should be empty
* Fixed crash when an invalid Location URL is returned from a redirect. Fixes#1386
* CHANGELOG entry
* changed catch(e) -> catch(error) to match rest of code, added comment
Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
* suppress error on invalid redirect URL when options.redirect == manual
Co-authored-by: Tasos Bitsios <tasos.bitsios@import.io>
Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
* remove buffer example
* show example of posting and getting a formdata instance
* recommend using builtin AbortController
* recommend posting blob instead of stream
* we do support formdata
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