media: Also consider extension in FromContent

As used in `resources.GetRemote`.

This will now reject image files with text and text files with images.
This commit is contained in:
Bjørn Erik Pedersen
2021-12-21 10:35:33 +01:00
parent ce04011096
commit 6779117f72
7 changed files with 85 additions and 43 deletions

BIN
media/testdata/fake.js vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

3
media/testdata/fake.png vendored Normal file
View File

@@ -0,0 +1,3 @@
function foo() {
return "foo";
}

BIN
media/testdata/resource.jpe vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB