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

Do not register pdf mime type implicitly #453

Open
aeden opened this issue Sep 17, 2015 · 1 comment
Open

Do not register pdf mime type implicitly #453

aeden opened this issue Sep 17, 2015 · 1 comment

Comments

@aeden
Copy link

aeden commented Sep 17, 2015

Right now

Mime::Type.register('application/pdf', :pdf)
registered the pdf extension. This means that when someone goes to a page and ends the URL in .pdf, it will result in a 500 error.

I humbly request that you make the registration of PDF a choice.

@unixmonkey
Copy link
Collaborator

I am able to reproduce the issue, but I don't see how it is better to not register the mime type.

If you go to a random URL and end it with .gif or .json you have the same issue, right?

There's a longstanding open issue on Rails for this that has some creative ways to prevent this from happening, but I think I'm with you that requesting a format you don't implement on each action shouldn't raise an ActionView::MissingTemplate error.

Are you not registering it in your app? How do you handle serving pdf's without it, as octet-stream downloads?

I'm open to suggestions or pull requests for the configuration initializer if you think that's the best route to take, but I would think it should be enabled by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants