Skip to content

Commit ccc33db

Browse files
authored
Compress uploaded rageshakes. (element-hq#3647)
1 parent 66a4738 commit ccc33db

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"matrix-js-sdk": "matrix-org/matrix-js-sdk#develop",
6666
"matrix-react-sdk": "matrix-org/matrix-react-sdk#develop",
6767
"modernizr": "^3.1.0",
68+
"pako": "^1.0.5",
6869
"q": "^1.4.1",
6970
"react": "^15.4.0",
7071
"react-dnd": "^2.1.4",

‎src/vector/submit-rageshake.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
import pako from 'pako';
1718
import q from "q";
1819

1920
import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg';
@@ -78,7 +79,10 @@ export default async function sendBugReport(bugReportEndpoint, opts) {
7879
// encode as UTF-8
7980
const buf = new TextEncoder().encode(entry.lines);
8081

81-
body.append('log', new Blob([buf]), entry.id);
82+
// compress
83+
const compressed = pako.gzip(buf);
84+
85+
body.append('compressed-log', new Blob([compressed]), entry.id);
8286
}
8387
}
8488

0 commit comments

Comments
 (0)