Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Add HTTP headers to avoid proxy caching
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePirateWhoSmellsOfSunflowers committed Feb 13, 2017
1 parent 85e28b2 commit 2ff9375
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion lib/listeners/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down Expand Up @@ -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('/<path:request_uri>', methods=['GET'])
def handle_get(request_uri):
"""
Expand Down
11 changes: 10 additions & 1 deletion lib/listeners/http_com.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down Expand Up @@ -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('/<path:request_uri>', methods=['GET'])
def handle_get(request_uri):
"""
Expand Down

0 comments on commit 2ff9375

Please sign in to comment.