Skip to content

Commit

Permalink
Reorder ACE signature check (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
Borewit authored Sep 8, 2024
1 parent 19fc36d commit c01b230
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1129,16 +1129,6 @@ export class FileTypeParser {
};
}

if (this.checkString('**ACE', {offset: 7})) {
await tokenizer.peekBuffer(this.buffer, {length: 14, mayBeLess: true});
if (this.checkString('**', {offset: 12})) {
return {
ext: 'ace',
mime: 'application/x-ace-compressed',
};
}
}

if (
this.checkString('WEBVTT')
&& (
Expand Down Expand Up @@ -1432,6 +1422,14 @@ export class FileTypeParser {
};
}

// ACE: requires 14 bytes in the buffer
if (this.checkString('**ACE', {offset: 7}) && this.checkString('**', {offset: 12})) {
return {
ext: 'ace',
mime: 'application/x-ace-compressed',
};
}

// -- 15-byte signatures --

if (this.checkString('BEGIN:')) {
Expand Down

0 comments on commit c01b230

Please sign in to comment.