cloudhead / node-static

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

read content-type from response #184

Open leviwheatcroft opened 7 years ago

leviwheatcroft commented 7 years ago

currently I don't think there's any way to set headers on a per request basis.. this patch allows headers to be set prior to calling nodeStatic.serve.

In addition, currently Content-Type would never be set before being read at line 347, by using res.getHeader you allow this header to be explicitly set on this response outside this module.