Compress uploaded rageshakes. (#3647)

This commit is contained in:
Richard van der Hoff 2017-04-18 17:23:34 +01:00 committed by GitHub
parent 66a473863a
commit ccc33db9dd
2 changed files with 6 additions and 1 deletions

View File

@ -65,6 +65,7 @@
"matrix-js-sdk": "matrix-org/matrix-js-sdk#develop",
"matrix-react-sdk": "matrix-org/matrix-react-sdk#develop",
"modernizr": "^3.1.0",
"pako": "^1.0.5",
"q": "^1.4.1",
"react": "^15.4.0",
"react-dnd": "^2.1.4",

View File

@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import pako from 'pako';
import q from "q";
import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg';
@ -78,7 +79,10 @@ export default async function sendBugReport(bugReportEndpoint, opts) {
// encode as UTF-8
const buf = new TextEncoder().encode(entry.lines);
body.append('log', new Blob([buf]), entry.id);
// compress
const compressed = pako.gzip(buf);
body.append('compressed-log', new Blob([compressed]), entry.id);
}
}