Skip to content

Commit 82c0385

Browse files
committed
MOBILE-3213 core: Handle anchors when cleaning extensions
1 parent c485afe commit 82c0385

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/providers/utils/mimetype.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@ export class CoreMimetypeUtilsProvider {
6868
}
6969

7070
// If the extension has parameters, remove them.
71-
const position = extension.indexOf('?');
71+
let position = extension.indexOf('?');
72+
if (position > -1) {
73+
extension = extension.substr(0, position);
74+
}
75+
76+
// If the extension has an anchor, remove it.
77+
position = extension.indexOf('#');
7278
if (position > -1) {
7379
extension = extension.substr(0, position);
7480
}

0 commit comments

Comments
 (0)