From 6682a51050840b05d898f6f6bc3d34640603c828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jimmy=20W=C3=A4rting?= Date: Fri, 19 Apr 2019 16:50:22 +0200 Subject: [PATCH] discard bad mime types per spec --- Blob.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Blob.js b/Blob.js index df7dd43..247a2a1 100644 --- a/Blob.js +++ b/Blob.js @@ -358,7 +358,14 @@ ? concatTypedarrays(chunks) : [].concat.apply([], chunks) this.size = this._buffer.length - this.type = opts ? opts.type || '' : '' + + this.type = opts.type || '' + if (/[^\u0020-\u007E]/.test(this.type)) { + this.type = '' + } else { + this.type = this.type.toLowerCase() + } + } Blob.prototype.slice = function (start, end, type) {