CERN-CERT / WAD

Web application/technology detection tool
GNU General Public License v3.0
205 stars 48 forks source link

Running detect() or detect_multiple() on a webradio will make the script hang #35

Open outsbart opened 2 years ago

outsbart commented 2 years ago

funny little bug

how to reproduce: wad.Detector().detect("https://webradio.divsi.unimi.it")

Feandil commented 2 years ago

Funny little bug indeed. Taking a quick look, the issue is, I think, that this URL returns an infinite chunked 'audio/mpeg'. This means that the read at https://github.com/CERN-CERT/WAD/blob/master/wad/detection.py#L97 never returns. I guess we should set up a sort of limit there...

outsbart commented 2 years ago

Exactly, one of the solution could be using requests' iter_content and allowing the code to stop reading after a certain size threshold is reached.

Something like this