4 ms·
Pretty pointless since all this does is check the x-powered-by HTTP response header (which can be turned off[1]). If this captured other web frameworks as well
by laumars 13y ago
Pretty pointless since all this does is check the x-powered-by HTTP response header (which can be turned off[1]). If this captured other web frameworks as well (eg PHP also outputs to x-powered-by in it's default config) then this might be a little less pointless - but even then, most production sites should have those information leaks sealed anyway (you don't actually improve security, but at least it slows the attacker down a little as you're not spoon-feeding them information about your server build)
[1] http://stackoverflow.com/questions/5867199/cant-get-rid-of-header-x-powered-byexpress http://stackoverflow.com/questions/5867199/cant-get-rid-of-h...
- avree 13y agoDoes node even have an x-powered-by response header by default? I thought you need a framework (like Express.js) and then to not have turned off the header.
- wlaurance 13y agoIt checks x-powered-by and Server in some cases. https://github.com/dotheyusenode/dotheyusenode/blob/master/checkers/headers.js#L3 https://github.com/dotheyusenode/dotheyusenode/blob/master/c... It also tries to read through the Javascript served up to see if it uses browserify. https://github.com/dotheyusenode/dotheyusenode/blob/master/checkers/needsjs/browserify.js#L1 https://github.com/dotheyusenode/dotheyusenode/blob/master/c... But yes it is a glorified `curl -I www.foo.com | grep -i 'x-powered-by` UI
- laumars 13y agoTechnically it's more like "curl -i" rather than "-I" since it does a GET request rather than a HEAD request. Which is a good thing as the former is more accurate. There are rare occasions when a web server might be sending wrong headers which get overwritten with the correct headers from the executing code (I think one of OVH's portals suffered from this issue - though that may have since been fixed) You probably might want to stick "-s" in there too; silence the transfer statistics which curl (annoyingly) adds when output is piped / redirected.
- wlaurance 13y agoI should clarify that I am using the request module to make GET requests on the url submitted. But yes, I dislike that the curl stats print by default when output is redirected :/
- laumars 13y ago> I should clarify that I am using the request module to make GET requests on the url submitted. Yeah I saw (I had a browse through your source after your previous post). As a side note, I was impressed with just how readable your code was (even for someone like myself with very poor Javascript skills). I can't comment on how much credit node.js deserves for that, but I've seen people turn even the most readable of languages into line noise in the past. So it's always a pleasure to read code that doesn't require lines of comments to explain their function.
- wlaurance 13y agoThanks! Node can thanked because it makes writing modular code painless, so separating concerns is very easy.