浏览代码

HUE-4454 [security] Disclosure of Web Server Information

Prakash Ranade 9 年之前
父节点
当前提交
9f52773
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. 3 1
      desktop/core/src/desktop/lib/wsgiserver.py
  2. 2 0
      desktop/core/src/desktop/settings.py

+ 3 - 1
desktop/core/src/desktop/lib/wsgiserver.py

@@ -1523,7 +1523,9 @@ class CherryPyWSGIServer(object):
     nodelay = True
     
     ConnectionClass = HTTPConnection
-    environ = {}
+    environ = {
+        "SERVER_SOFTWARE": os.getenv('SERVER_SOFTWARE')
+    }
     
     # Paths to certificate and private key files
     ssl_certificate = None

+ 2 - 0
desktop/core/src/desktop/settings.py

@@ -467,6 +467,8 @@ SKIP_SOUTH_TESTS = True
 # Set up environment variable so Kerberos libraries look at our private
 # ticket cache
 os.environ['KRB5CCNAME'] = desktop.conf.KERBEROS.CCACHE_PATH.get()
+if not os.getenv('SERVER_SOFTWARE'):
+  os.environ['SERVER_SOFTWARE'] = 'apache'
 
 # If Hue is configured to use a CACERTS truststore, make sure that the
 # REQUESTS_CA_BUNDLE is set so that we can use it when we make external requests.