Skip to content

Commit

Permalink
Pass mime type to XML parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Sorixelle committed Sep 1, 2024
1 parent 66ce57c commit 02ad4d9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import semverMaxSatisfying from "semver/ranges/max-satisfying";
import urljoin from "url-join";
import { DOMParser } from "@xmldom/xmldom";
import { DOMParser, MIME_TYPE } from "@xmldom/xmldom";
import xpath from "xpath";
import type { Config } from "./config";

Expand All @@ -39,7 +39,10 @@ async function getVersionInfo(config: Config): Promise<VersionInfo> {
}

const metaXml = await metaXmlRes.text();
const metaDoc = new DOMParser().parseFromString(metaXml);
const metaDoc = new DOMParser().parseFromString(
metaXml,
MIME_TYPE.XML_APPLICATION,
);
const latestVersion = xpath.select1(
"string(/metadata/versioning/latest)",
metaDoc,
Expand Down

0 comments on commit 02ad4d9

Please sign in to comment.