beefy icon indicating copy to clipboard operation
beefy copied to clipboard

read static files with filed instead of createReadStream

Open andyperlitch opened this issue 13 years ago • 3 comments

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).

andyperlitch avatar Mar 27 '13 00:03 andyperlitch

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!

chrisdickinson avatar Mar 28 '13 07:03 chrisdickinson

No worries and no rush man!

andyperlitch avatar Mar 28 '13 17:03 andyperlitch

+1 to using filed

max-mapper avatar May 22 '13 05:05 max-mapper