changeset 3722:75f8d206e551

component file sharing: set server name at render time
author Goffi <goffi@goffi.org>
date Tue, 25 Jan 2022 17:15:00 +0100
parents 6878745a47e8
children 1cdb9d9fad6b
files sat/plugins/plugin_comp_file_sharing.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sat/plugins/plugin_comp_file_sharing.py	Tue Jan 25 17:13:32 2022 +0100
+++ b/sat/plugins/plugin_comp_file_sharing.py	Tue Jan 25 17:15:00 2022 +0100
@@ -82,10 +82,10 @@
     "{used_space}, you can't upload {file_size} more."
 )
 
-server.version = unicodedata.normalize(
+HTTP_VERSION = unicodedata.normalize(
     'NFKD',
     f"{C.APP_NAME} file sharing {C.APP_VERSION}"
-).encode('ascii','ignore')
+)
 
 
 class HTTPFileServer(resource.Resource):
@@ -122,6 +122,7 @@
             return 'attachment'
 
     def render(self, request):
+        request.setHeader("server", HTTP_VERSION)
         request.setHeader("Access-Control-Allow-Origin", "*")
         request.setHeader("Access-Control-Allow-Methods", "OPTIONS, HEAD, GET, PUT")
         request.setHeader(