From c71c1b62be2cd5684562e2cfa03a4669b2b5ea90 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@libreserver.org>
Date: Wed, 14 Jun 2023 23:34:58 +0100
Subject: [PATCH] Attempt NetSurf compatibility

---
 daemon.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/daemon.py b/daemon.py
index a85da9ca8..a63a8155b 100644
--- a/daemon.py
+++ b/daemon.py
@@ -810,7 +810,8 @@ class PubServer(BaseHTTPRequestHandler):
                 return False
         if accept_str.startswith('*') or 'text/html' in accept_str:
             if self.headers.get('User-Agent'):
-                if text_mode_browser(self.headers['User-Agent']):
+                ua_str = self.headers['User-Agent']
+                if text_mode_browser(ua_str) or 'NetSurf/' in ua_str:
                     return True
             if 'text/html' not in accept_str:
                 return False