Added progress capturing support for node.js environment;#4215
Added progress capturing support for node.js environment;#4215DigitalBrainJS wants to merge 2 commits intoaxios:mainfrom
Conversation
70451f1 to
0fb24a6
Compare
Added `Headers` helper class; Refactored `http` adapter; `maxBodyLength` was set explicitly to 10MB in the default config object;
0fb24a6 to
c8e4234
Compare
…e-capture-progress; Fixed missed early exit when URL parsing fails;
|
@DigitalBrainJS this one seems relevant too, but I think as with the other pull request this probably needs some attention 😄, tag me when you are ready for me to look at it and merge |
|
@DigitalBrainJS please let me know if you will get this done soon, I would like to include it in v1? |
|
@jasonsaayman The PR refactoring is stuck because it depends on the new Headers interface, but its implementation brings significant breaking changes for users in the transformation chains as the headers become a map-like object rather than a hash object.
So I'm going to split this in two PR's - with Headers helper and progress capturing itself. |
|
I think for a v1 we should try not to go with the full refactor, we can do that asap with work on v2 |
This PR adds the ability to capture
upload&downloadprogress in node.js environment. All axios data types (stream,buffer,string,ArrayBuffer,Uint8Array) are supported as they are converted to a stream if progress capture is required.To make this workhttpadapter was extensively refactoredBuffer.frommethod.onUploadProgress&onDownloadProgresshandlers are throttled by the limit of 10 calls per second. These handlers will receive the following data structure:{loaded: Number, total: Number, progress: Float}Headershelper class to work with case insensitive headers;maxBodyLengthoption of the default config object was explicitly set to10MB;Update: