Explorar o código

fixed charset parsing

Gildas %!s(int64=7) %!d(string=hai) anos
pai
achega
f22dd37f93
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/single-file/single-file-browser.js

+ 1 - 1
lib/single-file/single-file-browser.js

@@ -50,7 +50,7 @@ this.SingleFile = (() => {
 					return "data:base64,";
 				}
 			} else {
-				const matchCharset = contentType.match(/\s*;\s*charset\s*=\s*(.*)(;|$)/i);
+				const matchCharset = contentType.match(/\s*;\s*charset\s*=\s*"?([^";]*)"?(;|$)/i);
 				if (matchCharset && matchCharset[1]) {
 					const charSet = matchCharset[1].toLowerCase();
 					if (charSet != "utf-8") {