Update server.py
Some checks failed
Test web app / Check syntax (push) Successful in 9s
Test web app / Test server with Flask Dev Mode (push) Failing after 9s
Test web app / Test server with Gunicorn (WSGI) (push) Failing after 9s
Test web app / Test server with Hypercorn (ASGI) (push) Failing after 11s
Create Docker image (unstable) / deploy (push) Has been cancelled

This commit is contained in:
Mohammed Qureshi (Nova Cat) 2025-06-16 18:09:05 -07:00
parent 52b811f03d
commit a96054d3a5

View file

@ -1,5 +1,6 @@
#!/usr/bin/python3
import asyncio, traceback, socket, ssl, zipfile, uuid, io, os
from asgiref.wsgi import WsgiToAsgi
from OpenSSL import crypto
from urllib.parse import urlparse, quote
from flask import Flask, request, redirect, send_file, Response, make_response
@ -398,6 +399,9 @@ def relay():
else:
resp = make_response(f'<!DOCTYPE html>\n<html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/style.css"><title>{title}</title></head><body>{code}</body></html>', 500)
return resp
app_asgi = WsgiToAsgi(app)
if __name__ == '__main__':
# run() method of Flask class runs the application
# on the local development server.