Weilbyte
3 years ago
No known key found for this signature in database
GPG Key ID: E1EB2BFCF73B5B9F
1 changed files with
7 additions and
1 deletions
-
PVEDiscordDark/serve.py
|
|
@ -37,12 +37,18 @@ class Server(BaseHTTPRequestHandler): |
|
|
|
elif ext == "js": |
|
|
|
data = open(os.path.join(DIR_JS, "PVEDiscordDark.js"), "rb").read() |
|
|
|
type = "application/javascript" |
|
|
|
elif ext == "png" or ext == "jpg" or ext == "jpeg" or ext == "svg": |
|
|
|
elif ext == "png" or ext == "jpg" or ext == "jpeg": |
|
|
|
try: |
|
|
|
data = open(os.path.join(DIR_IMAGES, file), "rb").read() |
|
|
|
type = f"image/{ext}" |
|
|
|
except FileNotFoundError: |
|
|
|
status = 404 |
|
|
|
elif ext == "svg": |
|
|
|
try: |
|
|
|
data = open(os.path.join(DIR_IMAGES, file), "rb").read() |
|
|
|
type = f"image/svg+xml" |
|
|
|
except FileNotFoundError: |
|
|
|
status = 404 |
|
|
|
else: |
|
|
|
status = 400 |
|
|
|
self._set_headers(status, type) |
|
|
|