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

read static files with filed instead of createReadStream #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andyperlitch
Copy link

This tiny change reads static files with filed instead of with fs.createReadStream so that they are sent with the correct mime-type (currently, an annoying mime-type warning shows up in chrome saying js files were interpreted as js but transferred as text/plain).

There is a minor trade-off here: because of a bug in filed, the stream created by the filed() method never actually emits an 'end' event, which means that the log() function in beefy doesn't get triggered. IMHO this is better than that annoying mime-type warning. Also, mikeal is bound to fix this sooner or later (hopefully sooner).

@chrisdickinson
Copy link
Owner

Hi! I'm sorry this is taking me so long to respond to -- it's been a busy week! I promise to pull things down tomorrow and test locally. For whatever reason I had filed installed originally (and it was responsible for serving up files) but I (or someone else) had removed it. I'll see if I can't drudge up why we may have moved away from it; but if it was completely capricious I'll see about merging.

Thanks for your patience!

@andyperlitch
Copy link
Author

No worries and no rush man!

@max-mapper
Copy link

+1 to using filed

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

Successfully merging this pull request may close these issues.

3 participants