cloudhead / node-static

rfc 2616 compliant HTTP static-file server module, with built-in caching.
MIT License
2.17k stars 245 forks source link

"Range request exceeds file boundaries" in console #212

Open Zarel opened 6 years ago

Zarel commented 6 years ago

I got some errors in my console:

Range request exceeds file boundaries, goes until byte no 32768 against file size of 450 bytes
Error: Range request present but invalid, might serve whole file instead

Looks like either someone's trying to probe me for vulns, or someone's HTTP client is buggy. But why is this output to my error console? It seems like this should either be a 400 status code, or just ignored entirely. There should at least be some setting to turn it off, so my console can be reserved for server-side errors rather than client-side errors.

sammyt291 commented 4 years ago

I can replicate this by linking to a node-static served page under 524287bytes in facebook messenger.

Range request exceeds file boundaries, goes until byte no 524287 against file size of 203 bytes

The range request on facebook messenger is it trying to generate a preview for the link if possible.

"Might serve file instead", why might? can we force it to? And if so, what are the implications?

andrewhodel commented 2 years ago

This is the same issue as #185.

This is about standard output and standard error, as it is consistently request-able from any HTTP client to any HTTP server using node-static, it should not be printed to standard output or standard error.