Merge pull request #455 from ThePirateWhoSmellsOfSunflowers/add-proxy-headers

Add HTTP headers to avoid proxy caching
mdns
Chris Ross 2017-04-09 16:16:46 -04:00 committed by GitHub
commit 1ad0e12b80
2 changed files with 20 additions and 2 deletions

View File

@ -97,7 +97,7 @@ class Listener:
'Value' : ''
},
'ServerVersion' : {
'Description' : 'TServer header for the control server.',
'Description' : 'Server header for the control server.',
'Required' : True,
'Value' : 'Microsoft-IIS/7.5'
}
@ -697,6 +697,15 @@ def send_message(packets=None):
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('/<path:request_uri>', methods=['GET'])
def handle_get(request_uri):
"""

View File

@ -98,7 +98,7 @@ class Listener:
'Value' : ''
},
'ServerVersion' : {
'Description' : 'TServer header for the control server.',
'Description' : 'Server header for the control server.',
'Required' : True,
'Value' : 'Microsoft-IIS/7.5'
}
@ -469,6 +469,15 @@ class Listener:
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('/<path:request_uri>', methods=['GET'])
def handle_get(request_uri):
"""