Search code examples
javascriptfetch

Javascript Fetch Get doesn't show data


I have a MCU with a small website. Now I want use FETCH for getting live data from it. It works fine, but one PC (with different browsers) don't show the values. In wireshark I see the right communication, but the browser dont get the received data.

here my code :


    function getInfo (){
    fetch('/info', {
        Method: 'GET',
    }) 
        .then((response) => response.text())
        .then((text) => {
            //handle data
            console.log(text);
            SetInfoValues(text);
        })
        .catch(error => {
            console.log('ERROR : ' + error);
            //handle error
        });
      } 

Wireshark shows me that my device give me the right respeonse

    0000   a4 bb 6d 45 36 07 9c 43 1e 7f ff ff 08 00 45 00   ..mE6..C......E.
    0010   00 93 00 52 00 00 ff 06 d6 f9 c0 a8 31 6d c0 a8   ...R........1m..
    0020   31 5b 00 50 fa 96 00 00 19 75 9e 59 77 26 50 19   1[.P.....u.Yw&P.
    0030   0e 8d 3f 37 00 00 66 49 50 3d 31 39 32 2e 31 36   ..?7..fIP=192.16
    0040   38 2e 34 39 2e 31 30 39 20 26 66 4d 41 43 3d 39   8.49.109 &fMAC=9
    0050   43 3a 34 33 3a 31 45 3a 37 46 3a 46 46 3a 46 46   C:43:1E:7F:FF:FF
    0060   20 26 66 53 45 52 49 41 4c 3d 32 33 31 30 39 39    &fSERIAL=231099
    0070   39 38 20 26 66 46 57 52 45 56 3d 31 30 30 34 20   98 &fFWREV=1004 
    0080   26 66 43 54 53 45 52 49 41 4c 3d 35 30 35 37 31   &fCTSERIAL=50571
    0090   35 35 20 26 66 43 54 46 57 52 45 56 3d 32 34 34   55 &fCTFWREV=244
    00a0   35                                                5

but in the browser I get 0 bytes in 5ms !? (timeout is 200ms) On all other PCs I get the received data in the browser. Debug on working PC Debug on failed PC

On the failed PC I get the error "net::ERR_EMPTY:RESPONSE" !?

I think it is a kind of firewall or so, but I don't know how I can find the application that block . The windows firewall is already disabled.

Thanks for your help !

disable firewall , use different browsers


Solution

  • In my case it was the anti spyware "Ad-Aware-Web-Companion" software. She was installed unintentionally. After uninstalling all works fine. Thanks for your help