Formatting and fix Internal Server Error on upload
This commit is contained in:
@@ -2,6 +2,7 @@ from sanic import Sanic, exceptions, response
|
||||
|
||||
app = Sanic("server80")
|
||||
|
||||
|
||||
# Send all HTTP users to HTTPS
|
||||
@app.exception(exceptions.NotFound, exceptions.MethodNotSupported)
|
||||
def redirect_everything_else(request, exception):
|
||||
@@ -10,6 +11,7 @@ def redirect_everything_else(request, exception):
|
||||
return response.redirect(f"https://{server}{path}", status=308)
|
||||
return response.text("Bad Request. Please use HTTPS!", status=400)
|
||||
|
||||
|
||||
# ACME challenge for LetsEncrypt
|
||||
@app.get("/.well-known/acme-challenge/<challenge>")
|
||||
async def letsencrypt(request, challenge):
|
||||
@@ -18,4 +20,5 @@ async def letsencrypt(request, challenge):
|
||||
except KeyError:
|
||||
return response.text(f"ACME challenge not found: {challenge}", status=404)
|
||||
|
||||
|
||||
acme_challenges = {}
|
||||
|
||||
Reference in New Issue
Block a user