You've already forked AstralRinth
forked from didirus/AstralRinth
fix: not checking file extension in loader detection (#5013)
This commit is contained in:
@@ -215,6 +215,9 @@ export function createManageVersionContext(
|
|||||||
|
|
||||||
async function checkIsResourcePack(file: File): Promise<boolean> {
|
async function checkIsResourcePack(file: File): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
|
const name = file.name.toLowerCase()
|
||||||
|
if (!name.endsWith('.zip')) return false
|
||||||
|
|
||||||
const zip = await JSZip.loadAsync(file)
|
const zip = await JSZip.loadAsync(file)
|
||||||
const entries = Object.keys(zip.files).map((f) => f.toLowerCase())
|
const entries = Object.keys(zip.files).map((f) => f.toLowerCase())
|
||||||
|
|
||||||
@@ -226,6 +229,9 @@ export function createManageVersionContext(
|
|||||||
|
|
||||||
async function checkIsDataPack(file: File): Promise<boolean> {
|
async function checkIsDataPack(file: File): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
|
const name = file.name.toLowerCase()
|
||||||
|
if (!name.endsWith('.zip')) return false
|
||||||
|
|
||||||
const zip = await JSZip.loadAsync(file)
|
const zip = await JSZip.loadAsync(file)
|
||||||
const entries = Object.keys(zip.files).map((f) => f.toLowerCase())
|
const entries = Object.keys(zip.files).map((f) => f.toLowerCase())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user