alefragnani / vscode-jenkins-status

Jenkins Status Extension for Visual Studio Code
MIT License
27 stars 20 forks source link

Fixes reading response data in multiple chunks #7

Closed vojtechhabarta closed 7 years ago

vojtechhabarta commented 7 years ago

This PR fixes problem with larger response from Jenkins API. When response data are larger it is needed to read all chunks and join them before parsing the json (http://stackoverflow.com/questions/5083914/get-the-whole-response-body-when-the-response-is-chunked).

(BTW instead of request library I would recommend to use axios which uses Promise API, parses JSON by default and works well with TypeScript async/await.)

alefragnani commented 7 years ago

Hi @vojtechhabarta,

First of all, thanks for the PR. I didn't have this issue, but probably because my Jenkins jobs are simple, and didn't fire chunks. I'll test it and release an update ASAP.

About the axios library, I'll take a look later, testing it with other features that I intend to add to the extension. Thanks for your suggestion.