From be6fd42e11ef926b3a798198dcaf5d02de53f410 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Dec 2020 04:01:02 -0800 Subject: [PATCH] Bump pako from 1.0.11 to 2.0.2 in /desktop (#1786) Summary: Bumps [pako](https://github.com/nodeca/pako) from 1.0.11 to 2.0.2.
Changelog

Sourced from pako's changelog.

[2.0.2] - 2020-11-19

Fixed

[2.0.1] - 2020-11-17

Changed

[2.0.0] - 2020-11-17

Changed

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pako&package-manager=npm_and_yarn&previous-version=1.0.11&new-version=2.0.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `dependabot rebase` will rebase this PR - `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `dependabot merge` will merge this PR after your CI passes on it - `dependabot squash and merge` will squash and merge this PR after your CI passes on it - `dependabot cancel merge` will cancel a previously requested merge and block automerging - `dependabot reopen` will reopen this PR if it is closed - `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Pull Request resolved: https://github.com/facebook/flipper/pull/1786 Reviewed By: passy Differential Revision: D25664507 Pulled By: cekkaewnumchai fbshipit-source-id: bd33a7a11ef38b54675cde31d1243742476263d9 --- desktop/plugins/network/package.json | 2 +- desktop/plugins/network/utils.tsx | 7 ++++++- desktop/yarn.lock | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/desktop/plugins/network/package.json b/desktop/plugins/network/package.json index cda1d2aa8..bf774c43b 100644 --- a/desktop/plugins/network/package.json +++ b/desktop/plugins/network/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "lodash": "^4.17.19", - "pako": "^1.0.11", + "pako": "^2.0.2", "xml-beautifier": "^0.4.0" }, "peerDependencies": { diff --git a/desktop/plugins/network/utils.tsx b/desktop/plugins/network/utils.tsx index 148c81adb..a6e238142 100644 --- a/desktop/plugins/network/utils.tsx +++ b/desktop/plugins/network/utils.tsx @@ -30,9 +30,14 @@ export function decodeBody(container: Request | Response): string { getHeaderValue(container.headers, 'Content-Encoding') === 'gzip'; if (isGzip) { try { + const binStr = Base64.atob(container.data); + const dataArr = new Uint8Array(binStr.length); + for (let i = 0; i < binStr.length; i++) { + dataArr[i] = binStr.charCodeAt(i); + } // The request is gzipped, so convert the base64 back to the raw bytes first, // then inflate. pako will detect the BOM headers and return a proper utf-8 string right away - return pako.inflate(Base64.atob(container.data), {to: 'string'}); + return pako.inflate(dataArr, {to: 'string'}); } catch (e) { // on iOS, the stream send to flipper is already inflated, so the content-encoding will not // match the actual data anymore, and we should skip inflating. diff --git a/desktop/yarn.lock b/desktop/yarn.lock index 50929b161..051203270 100644 --- a/desktop/yarn.lock +++ b/desktop/yarn.lock @@ -9738,7 +9738,12 @@ paged-request@^2.0.1: dependencies: axios "^0.18.0" -pako@^1.0.11, pako@~1.0.2: +pako@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.2.tgz#8a72af7a93431ef22aa97e0d53b0acaa3c689220" + integrity sha512-9e8DRI3+dRLomCmMBAH30B2ejh+blwXr7VmMEx/pVFZlSDA7oyI8uKMhKXr8IrZpoxBF2YlxUvhqRXzTT1i0NA== + +pako@~1.0.2: version "1.0.11" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==