Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/scripts/modules/utils/multipartmixed2har.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,13 @@ const deMultipart = (content, req, res) => {
* @param {Object} header
*/
let resContentType = res.headers.find(header => header.name.toLowerCase() === 'content-type').value;
let raw = atob(content);
let reqBoundary = '--' + req.postData.mimeType.split('boundary=')[1];
let resBoundary = '--' + resContentType.split('boundary=')[1];
// jscs:disable
let requestsRaw = req.postData.text.split(reqBoundary)
.filter(line => !line.startsWith('--') && line !== '')
.filter(removeEmptyLinesFilter);
let responseRaw = raw.split(resBoundary)
let responseRaw = content.split(resBoundary)
.filter(line => !line.startsWith('--') && line !== '')
.filter(removeEmptyLinesFilter);
// jscs:enable
Expand All @@ -218,7 +217,10 @@ const getContent = entry =>
* Gets content of an entry.
* @param {Object} content
*/
entry.getContent(content => resolve(content));
entry.getContent((content, encoding) => {
const decodedContent = (encoding === 'base64') ? atob(content) : content;
resolve(decodedContent);
});
}));

exports.getContent = getContent;
Expand Down
Loading