From d0621f7497c4c4a2f72a072e9f768a89a14adb00 Mon Sep 17 00:00:00 2001 From: MurakamiShinyu Date: Tue, 29 Aug 2023 17:59:31 +0900 Subject: [PATCH] Experiment: EPUB encryption support test-2a --- packages/core/src/vivliostyle/net.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/core/src/vivliostyle/net.ts b/packages/core/src/vivliostyle/net.ts index de350cd28..e541b030d 100644 --- a/packages/core/src/vivliostyle/net.ts +++ b/packages/core/src/vivliostyle/net.ts @@ -69,7 +69,9 @@ export function ajax( opt_type, opt_method, opt_data, - opt_contentType, + opt_contentType ?? opt_type === XMLHttpRequestResponseType.DOCUMENT + ? "application/xml; charset=UTF-8" + : undefined, ).then((xhr2) => { xhr2.url = url; frame.finish(xhr2); @@ -146,6 +148,9 @@ export function ajax( opt_contentType || "text/plain; charset=UTF-8", ); request.send(opt_data); + } else if (opt_contentType) { + request.overrideMimeType(opt_contentType); + request.send(null); } else { if ( /^file:|^https?:\/\/[^/]+\.githubusercontent\.com|\.(xhtml|xht|opf)$/i.test(