AJMitev / FileTypeChecker

Cross platform file type validator for .NET
MIT License
139 stars 27 forks source link

Renamed executable file does not detect as executable #11

Closed Rocky-Moon closed 3 years ago

Rocky-Moon commented 3 years ago

Describe the bug If I rename a file calc.exe -> calc.png and then upload it, it's not detected as executable.

To Reproduce Rename an exe file to another file extension, eg: calc.exe -> calc.png and then upload and try to detect it as executable:

        if (stream.Is<Executable>() || stream.Is<ExecutableAndLinkableFormat>())
        {
            return new ValidationResult("Invalid file was detected.");
        }

Expected behavior I would expect the file to be still be detected as an executable.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Rocky-Moon commented 3 years ago

Sorry hadn't populated the stream! Working as expected 👍