server socket receives 2 http requests when I send from chrome and receives one when I send from firefox

前端 未结 7 2186

I wrote a simple server using socket API in C under linux which listens at port 80 on localhost. Now when I send a request from the browser google chrome to the program it r

7条回答
  •  孤独总比滥情好
    2020-11-27 19:06

    To me it only happen if I write/paste to chrome url field. It is never triggered from anchor tag. If you log url of request you can see it is sent two times.

    My was /users. I added consloe.log() in code (node server) and you could see /users appear twice. And since i was not logged in app I would get double notification messages.

    This example can reproduce it:

    Script 1 name: redirect.php

    Script 2 name: to.php

     ';
    }
    
    unset($_SESSION['x']);
    

    So if you copy paste "SERVERNAME/redirect.php" in url field eventualy you get doubled messages.

提交回复
热议问题