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

Custom mime type for extensionless files #22

Open
lyonzy opened this issue Mar 31, 2016 · 2 comments
Open

Custom mime type for extensionless files #22

lyonzy opened this issue Mar 31, 2016 · 2 comments

Comments

@lyonzy
Copy link

lyonzy commented Mar 31, 2016

Hello,

I'm looking to do hosting on S3 without extensions on URLs. What would be really nice here is a custom mime type for files with no extension, that way I can have my html pages created without an extension and just served normally.

The solution I've got currently is this, in lib/middlewares/route.js:
res.setHeader('Content-Type', extname ? mime.lookup(extname) : config.extensionless_mime_type || 'application/octet-stream');

and this in _config.yml:
extensionless_mime_type: 'text/html'

Would this be a suitable feature request and implementation? If so I can submit a pull request.

Cheers,
Matt

@shirotech
Copy link

+1 Yes please!! Been using nginx to hack around this when developing locally.

@egonbraun
Copy link

I am having the same problem, the default mime type for me is also incorrect.

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

3 participants