Why does node.js, http-server, show that there are two request coming?

前端 未结 1 1889
庸人自扰
庸人自扰 2020-12-11 10:20

I have the following simple http-server setup using node.js:

var http = require(\'http\');
var port = 12311

http.createServer(function (req, res) {

    con         


        
相关标签:
1条回答
  • 2020-12-11 11:17

    It's usually the request for the favicon.ico. Even if you don't have one, it's requested as the norm defines a default file path if you don't set the relevant <link rel="shortcut icon"... in the header.

    The best ways to find about the requests are :

    • client side, by opening the developer tools and looking at the network tab.
    • server side, by logging req.url
    0 讨论(0)
提交回复
热议问题