Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Type Validation does not check if extension and MIME Type match #8

Closed
helphop opened this issue Mar 1, 2019 · 1 comment
Closed

Comments

@helphop
Copy link

helphop commented Mar 1, 2019

I have tested the validation by changing the extension of a file. For example I took a file called 'test.pdf' and changed it to 'test.docx'. I validate as follows:

validates :file, presence: true, blob: { content_type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'}

This passes. Shouldn't the validation fail since this is really a pdf and not a docx document?

@aki77
Copy link
Owner

aki77 commented Sep 2, 2019

This gem uses the activestorage content type guess as is.
The following may be helpful.
rails/rails#32833

@aki77 aki77 closed this as completed Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants