I am building a Node.js powered website. I want to block anyone trying to CURL or WGET my website, how do I do that?
我正在构建一个节点。js的网站。我想要阻止任何人试图卷起来或获取我的网站,我怎么做呢?
1 个解决方案
#1
0
While you can check the User-Agent
header value, this is easily spoofed or it can be not sent altogether (both curl
and wget
can customize this header). So trying to block any particular client based on that header is unreliable.
虽然可以检查User-Agent header值,但这很容易被欺骗,或者不能全部发送(curl和wget都可以自定义这个header)。因此,试图基于该头阻塞任何特定客户端是不可靠的。
#1
0
While you can check the User-Agent
header value, this is easily spoofed or it can be not sent altogether (both curl
and wget
can customize this header). So trying to block any particular client based on that header is unreliable.
虽然可以检查User-Agent header值,但这很容易被欺骗,或者不能全部发送(curl和wget都可以自定义这个header)。因此,试图基于该头阻塞任何特定客户端是不可靠的。