mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
404 on missing file
This commit is contained in:
parent
ab131cb55e
commit
72a9d75330
@ -9,17 +9,20 @@ model = T2I()
|
|||||||
|
|
||||||
class DreamServer(BaseHTTPRequestHandler):
|
class DreamServer(BaseHTTPRequestHandler):
|
||||||
def do_GET(self):
|
def do_GET(self):
|
||||||
self.send_response(200)
|
|
||||||
if self.path == "/":
|
if self.path == "/":
|
||||||
|
self.send_response(200)
|
||||||
self.send_header("Content-type", "text/html")
|
self.send_header("Content-type", "text/html")
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
with open("./scripts/static/index.html", "rb") as content:
|
with open("./scripts/static/index.html", "rb") as content:
|
||||||
self.wfile.write(content.read())
|
self.wfile.write(content.read())
|
||||||
else:
|
elif os.path.exists("." + self.path):
|
||||||
|
self.send_response(200)
|
||||||
self.send_header("Content-type", "image/png")
|
self.send_header("Content-type", "image/png")
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
with open("." + self.path, "rb") as content:
|
with open("." + self.path, "rb") as content:
|
||||||
self.wfile.write(content.read())
|
self.wfile.write(content.read())
|
||||||
|
else:
|
||||||
|
self.send_response(404)
|
||||||
|
|
||||||
def do_POST(self):
|
def do_POST(self):
|
||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user