forked from MarseyWorld/MarseyWorld
master
parent
1b7bfd667c
commit
f02032cbdc
|
@ -383,8 +383,7 @@ def disable_signups(v):
|
|||
@app.post("/admin/purge_cache")
|
||||
@admin_level_required(3)
|
||||
def purge_cache(v):
|
||||
response = str(requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data='{"purge_everything":true}').text)
|
||||
print(response)
|
||||
response = str(requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data='{"purge_everything":true}'))
|
||||
if response == "<Response [200]>": return {"message": "Cache purged!"}
|
||||
return {"error": "Failed to purge cache."}
|
||||
|
||||
|
|
Loading…
Reference in New Issue