Update display.tsx

This commit is contained in:
Romaric Mourgues
2023-04-05 15:43:53 +02:00
committed by GitHub
parent 8a5cc9a2e6
commit c35a18c2e8
@@ -20,6 +20,7 @@ export default (props: { download: string; name: string }) => {
const result = reader.result as string;
const link = result.match(/URL=(.*)/);
if (link && link[1]) {
if (!link[1].match(/^(http|https):\/\//)) throw new Error('Invalid link');
window.open(link[1], '_blank');
} else {
setError(true);