File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -223,8 +223,8 @@ var util = {
223223 } ,
224224
225225 /**
226- * Decide if data should be treated as binary based on the content
227- * and content-type.
226+ * Decide if data should be treated as binary based on the content (presence of non-printable characters
227+ * or replacement character) and content-type.
228228 *
229229 * @param {string } content - The data
230230 * @param {string } mimeType - The data's content-type
@@ -233,7 +233,7 @@ var util = {
233233 */
234234 shouldBeTreatedAsBinary ( content , mimeType ) {
235235 // eslint-disable-next-line no-control-regex
236- return ( mimeType && mimeType . match ( / c h a r s e t = b i n a r y / ) ) || / [ \x00 - \x1F ] / . test ( content ) ;
236+ return ( mimeType && mimeType . match ( / c h a r s e t = b i n a r y / ) ) || / [ \x00 - \x08 \x0E - \ x1F\uFFFD ] / . test ( content ) ;
237237 } ,
238238
239239 /**
You can’t perform that action at this time.
0 commit comments