Compare commits

...
2 Commits
Author SHA1 Message Date
Alok Saldanha 620181ae4d prepare for 0.3.7 release 2021-08-12 14:02:26 -04:00
Alok Saldanha 73a7920cc8 add back ip_address endpoint 2021-08-12 13:58:19 -04:00
3 changed files with 20 additions and 5 deletions
+4
View File
@@ -1,3 +1,7 @@
# 0.3.7
* added back /metadata/ip_address endpoint
# 0.3.6 # 0.3.6
* pinned version of werkzeug * pinned version of werkzeug
+1 -1
View File
@@ -7,4 +7,4 @@
# OR CONDITIONS OF ANY KIND, either express or implied. See the License for # OR CONDITIONS OF ANY KIND, either express or implied. See the License for
# the specific language governing permissions and limitations under the License. # the specific language governing permissions and limitations under the License.
__version__ = "0.3.6" __version__ = "0.3.7"
+15 -4
View File
@@ -52,6 +52,14 @@ def _force_https(app):
return wrapper return wrapper
def set_no_cache(resp):
resp.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
resp.headers["Pragma"] = "no-cache"
resp.headers["Expires"] = "0"
resp.headers["Cache-Control"] = "public, max-age=0"
return resp
app.wsgi_app = _force_https(app.wsgi_app) app.wsgi_app = _force_https(app.wsgi_app)
if ( if (
env.proxy_fix_for > 0 env.proxy_fix_for > 0
@@ -157,10 +165,7 @@ def filecrawl(path=None):
path=path, path=path,
) )
) )
resp.headers["Cache-Control"] = "no-cache, no-store, must-revalidate" set_no_cache(resp)
resp.headers["Pragma"] = "no-cache"
resp.headers["Expires"] = "0"
resp.headers["Cache-Control"] = "public, max-age=0"
return resp return resp
@@ -267,6 +272,12 @@ def do_terminate(path):
return redirect(url_for("do_GET_status"), code=302) return redirect(url_for("do_GET_status"), code=302)
@app.route("/metadata/ip_address", methods=["GET"])
def ip_address():
resp = make_response(env.ip)
return set_no_cache(resp)
def launch(): def launch():
env.validate() env.validate()
if not item_sources or not len(item_sources): if not item_sources or not len(item_sources):