single-file-core 1.3.25 → 1.3.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/index.js CHANGED
@@ -588,12 +588,14 @@ class Processor {
588
588
  this.stats.add("discarded", "HTML bytes", size - contentSize);
589
589
  }
590
590
  const filename = await util.formatFilename(content, this.doc, this.options);
591
+ const mimeType = util.getMimeType(this.options);
591
592
  const matchTitle = this.baseURI.match(/([^/]*)\/?(\.html?.*)$/) || this.baseURI.match(/\/\/([^/]*)\/?$/);
592
593
  const additionalData = this.processorHelper.getAdditionalPageData(this.doc, content, this.resources);
593
594
  const pageData = Object.assign({
594
595
  stats: this.stats.data,
595
596
  title: this.options.title || (this.baseURI && matchTitle ? matchTitle[1] : url.hostname ? url.hostname : ""),
596
597
  filename,
598
+ mimeType,
597
599
  content
598
600
  }, additionalData);
599
601
  if (this.options.addProof) {
package/core/util.js CHANGED
@@ -154,6 +154,9 @@ function getInstance(utilOptions) {
154
154
  formatFilename(content, doc, options) {
155
155
  return modules.templateFormatter.formatFilename(content, doc, options);
156
156
  },
157
+ getMimeType(options) {
158
+ return !options.compressContent || options.selfExtractingArchive ? "text/html" : "application/zip";
159
+ },
157
160
  async evalTemplate(template, options, content, doc, dontReplaceSlash) {
158
161
  return modules.templateFormatter.evalTemplate(template, options, content, doc, dontReplaceSlash);
159
162
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.3.25",
3
+ "version": "1.3.26",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",