diff --git a/lib/listeners/http.py b/lib/listeners/http.py index 3a8ea1e66..8fe198a2d 100644 --- a/lib/listeners/http.py +++ b/lib/listeners/http.py @@ -97,7 +97,7 @@ def __init__(self, mainMenu, params=[]): 'Value' : '' }, 'ServerVersion' : { - 'Description' : 'TServer header for the control server.', + 'Description' : 'Server header for the control server.', 'Required' : True, 'Value' : 'Microsoft-IIS/7.5' } @@ -687,6 +687,15 @@ def change_header(response): return response + @app.after_request + def add_proxy_headers(response): + "Add HTTP headers to avoid proxy caching." + response.headers['Cache-Control'] = "no-cache, no-store, must-revalidate" + response.headers['Pragma'] = "no-cache" + response.headers['Expires'] = "0" + return response + + @app.route('/', methods=['GET']) def handle_get(request_uri): """ diff --git a/lib/listeners/http_com.py b/lib/listeners/http_com.py index d2e375ca7..c5848be70 100644 --- a/lib/listeners/http_com.py +++ b/lib/listeners/http_com.py @@ -98,7 +98,7 @@ def __init__(self, mainMenu, params=[]): 'Value' : '' }, 'ServerVersion' : { - 'Description' : 'TServer header for the control server.', + 'Description' : 'Server header for the control server.', 'Required' : True, 'Value' : 'Microsoft-IIS/7.5' } @@ -458,6 +458,15 @@ def change_header(response): return response + @app.after_request + def add_proxy_headers(response): + "Add HTTP headers to avoid proxy caching." + response.headers['Cache-Control'] = "no-cache, no-store, must-revalidate" + response.headers['Pragma'] = "no-cache" + response.headers['Expires'] = "0" + return response + + @app.route('/', methods=['GET']) def handle_get(request_uri): """