Webserver Crash during Security Scan

I've recently setup an OpenVAS server on my network, just to occasionally scan and keep tabs on any necessary updates (I'm bored, it's Quarantine, it was a fun project). I've noticed that when it scans my 2 Raspberry Pi's running OctoPi, it kills the webserver. Any prints keep running, and I can still access the Webcam feed, however the webserver dies and I get the "Octoprint is currently not running" webpage. The server is still running, as plugins like PushOver, Spaghetti Detective, the Enclosure plugin, are still running and responding. I just have no way to get to the UI and do any controls.

In the logs there is a TON of output, as the scanner is trying all the different wordpress and such URL's.. Most of it is flagged as Warning, however there is this one section containing a handful of errors:

2020-10-30 13:09:25,210 - tornado.access - WARNING - 404 GET /SiteScope/htdocs/SiteScope.html (::ffff:192.168.4.86) 15.91ms
2020-10-30 13:09:25,372 - tornado.access - WARNING - 404 GET /NonExistent107688498/ (::ffff:192.168.4.86) 16.75ms
2020-10-30 13:09:25,399 - octoprint.server.views - WARNING - Client requested cache refresh via cache-control headers but we are printing. Not invalidating caches due to resource limitation. Append ?_refresh=true to the URL if you absolut
ely require a refresh now
2020-10-30 13:09:25,507 - tornado.access - WARNING - 404 GET /ControlManager/default.htm (::ffff:192.168.4.86) 8.69ms
2020-10-30 13:09:25,562 - tornado.application - ERROR - Uncaught exception GET /static/webassets/non-existent-446477620 (::ffff:192.168.4.86)
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/web.py", line 1590, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/util/tornado.py", line 1013, in get
    if self.should_use_precompressed():
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/util/tornado.py", line 1002, in should_use_precompressed
    and "gzip" in self.request.headers.get("Accept-Encoding"))
TypeError: argument of type 'NoneType' is not iterable
2020-10-30 13:09:25,565 - tornado.access - ERROR - 500 GET /static/webassets/non-existent-446477620 (::ffff:192.168.4.86) 3.48ms
2020-10-30 13:09:25,578 - tornado.access - WARNING - 404 GET /ControlManager/default.htm (::ffff:192.168.4.86) 9.28ms
2020-10-30 13:09:25,585 - tornado.application - ERROR - Uncaught exception GET /static/webassets/non-existent-1458004078 (::ffff:192.168.4.86)
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/web.py", line 1590, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/util/tornado.py", line 1013, in get
    if self.should_use_precompressed():
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/util/tornado.py", line 1002, in should_use_precompressed
    and "gzip" in self.request.headers.get("Accept-Encoding"))
TypeError: argument of type 'NoneType' is not iterable
2020-10-30 13:09:25,588 - tornado.access - ERROR - 500 GET /static/webassets/non-existent-1458004078 (::ffff:192.168.4.86) 3.78ms
2020-10-30 13:09:26,001 - tornado.access - WARNING - 404 GET /home/monitoring.cgi (::ffff:192.168.4.86) 9.53ms
2020-10-30 13:09:26,078 - tornado.access - WARNING - 404 GET /home/monitoring.cgi (::ffff:192.168.4.86) 10.37ms
2020-10-30 13:09:26,199 - tornado.access - WARNING - 404 GET /NonExistent446240993/ (::ffff:192.168.4.86) 12.72ms
2020-10-30 13:09:26,225 - octoprint.server.views - WARNING - Client requested cache refresh via cache-control headers but we are printing. Not invalidating caches due to resource limitation. Append ?_refresh=true to the URL if you absolutely require a refresh now
2020-10-30 13:09:26,387 - tornado.application - ERROR - Uncaught exception GET /static/webassets/non-existent-1522345911 (::ffff:192.168.4.86)
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/web.py", line 1590, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/util/tornado.py", line 1013, in get
    if self.should_use_precompressed():
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/util/tornado.py", line 1002, in should_use_precompressed
    and "gzip" in self.request.headers.get("Accept-Encoding"))
TypeError: argument of type 'NoneType' is not iterable
2020-10-30 13:09:26,391 - tornado.access - ERROR - 500 GET /static/webassets/non-existent-1522345911 (::ffff:192.168.4.86) 4.95ms
2020-10-30 13:09:26,407 - tornado.application - ERROR - Uncaught exception GET /static/webassets/non-existent-1985860661 (::ffff:192.168.4.86)
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/web.py", line 1590, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/util/tornado.py", line 1013, in get
    if self.should_use_precompressed():
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/util/tornado.py", line 1002, in should_use_precompressed
    and "gzip" in self.request.headers.get("Accept-Encoding"))
TypeError: argument of type 'NoneType' is not iterable
2020-10-30 13:09:26,411 - tornado.access - ERROR - 500 GET /static/webassets/non-existent-1985860661 (::ffff:192.168.4.86) 4.65ms
2020-10-30 13:09:26,589 - tornado.access - WARNING - 404 GET /cpqlogin.htm (::ffff:192.168.4.86) 10.74ms
2020-10-30 13:09:26,661 - tornado.access - WARNING - 404 GET /cpqlogin.htm (::ffff:192.168.4.86) 15.31ms

I'm running 2 instances of Octoprint, both on PI 3B+'s with the latest official release (One on Python3, one still on Python2). They're being scanned by another Raspberry Pi (4) running OpenVAS & Greenbone, scanner v5.1.3 (Yes, it's old).

Anyone know a good way to kick the webserver back into operation? Or recognize a bug that needs to be handled better?

Frenck, about an hour ago on discord picked this up and was preparing a PR to fix it for the next release - and as far as I know there is no way to kick the webserver back to operation once it has died.
Accept-Encoding headers can be empty by HTTP spec apparently, so that's be the issue here, and it has been overlooked in OctoPrint.

See also

and

Already fixed on maintenance and to be part of 1.5