节点静默地closuresURL中的文字空间的请求
让我们开始简单的服务器:
var http = require('http'); http.createServer(function (req, res) { console.log('asdasd'); res.end('asdasd'); }).listen(8898)
并提出一个简单的要求
curl -v 'localhost:8898/?ab' * Trying ::1... * Connected to localhost (::1) port 8898 (#0) > GET /?ab HTTP/1.1 > Host: localhost:8898 > User-Agent: curl/7.43.0 > Accept: */* > < HTTP/1.1 200 OK < Date: Thu, 13 Oct 2016 20:26:14 GMT < Connection: keep-alive < Content-Length: 6 < * Connection #0 to host localhost left intact asdasd
看起来好像一切都好。 但是,如果我们添加一个文字空间…
cornholio-osx:~/>curl -v 'localhost:8898/?ab' * Trying ::1... * Connected to localhost (::1) port 8898 (#0) > GET /?ab HTTP/1.1 > Host: localhost:8898 > User-Agent: curl/7.43.0 > Accept: */* > * Empty reply from server * Connection #0 to host localhost left intact
没有logging,也没有写入正文。
我认为,在URL中的字面空格是违反HTTP协议,但这是行为的HTTP投诉?