{"action":"closed","issue":{"url":"https://api.github.com/repos/mzabriskie/axios/issues/555","repository_url":"https://api.github.com/repos/mzabriskie/axios","labels_url":"https://api.github.com/repos/mzabriskie/axios/issues/555/labels{/name}","comments_url":"https://api.github.com/repos/mzabriskie/axios/issues/555/comments","events_url":"https://api.github.com/repos/mzabriskie/axios/issues/555/events","html_url":"https://github.com/mzabriskie/axios/issues/555","id":191721251,"number":555,"title":"What is the purpose of PROTECTION_PREFIX in default transformResponse?","user":{"login":"dominykas","id":505619,"avatar_url":"https://avatars.githubusercontent.com/u/505619?v=3","gravatar_id":"","url":"https://api.github.com/users/dominykas","html_url":"https://github.com/dominykas","followers_url":"https://api.github.com/users/dominykas/followers","following_url":"https://api.github.com/users/dominykas/following{/other_user}","gists_url":"https://api.github.com/users/dominykas/gists{/gist_id}","starred_url":"https://api.github.com/users/dominykas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominykas/subscriptions","organizations_url":"https://api.github.com/users/dominykas/orgs","repos_url":"https://api.github.com/users/dominykas/repos","events_url":"https://api.github.com/users/dominykas/events{/privacy}","received_events_url":"https://api.github.com/users/dominykas/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-25T15:11:32Z","updated_at":"2016-11-26T08:08:00Z","closed_at":"2016-11-26T08:08:00Z","body":"This is question is about [this regex `replace()`](https://github.com/mzabriskie/axios/blob/5faebabcd8f065e312b5c92081433d6ae1ef8c8f/lib/defaults.js#L59).\r\n\r\nI've looked in the issues, I've looked in the history and I've looked in the unit tests - but I couldn't find any clues - there doesn't seem to be an assert for it or any comments?\r\n\r\nI'm happy to PR a config setting or a removal of this option - ~~but for the use case I'm working with, it is not necessary, yet highly costly - Chrome seems to allocate memory for the copy of the whole response to do the regex replace/match. Considering, that the response I'm working with can go as high as 250Mb - doubling the RAM usage for just that one request becomes quite painful and occasionally leads to out of memory errors.~~ I misinterpreted the profile results - despite the fact that the regex replace allocates a lot of memory, there's even more memory that needs to be allocated for the JSON.parse anyways.\r\n\r\nAs a workaround, we'll try to use a custom, simpler transform, yet I'm still wondering whether this should be the default behavior?\r\n\r\nThanks."}}
{"actor":{"display_login":"nickuraltsev"}}