mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-12-24 16:08:55 +01:00
Hardcode CSS content type
By default, uvicorn uses the 'Content Type' value from 'Computer\HKEY_CLASSES_ROOT\.css' for the Content-Type header in its responses. Some systems have this set to 'application/x-css', an outdated content type used in the early days of CSS. Modern browsers ignore stylesheets that don't have the content-type 'text/css'. This change hardcodes the Content-Type to 'text/css', ignoring the registry.
This commit is contained in:
parent
24b631500a
commit
7af620f66e
@ -16,6 +16,8 @@ from easydiffusion import app, model_manager, task_manager
|
||||
from easydiffusion.types import TaskData, GenerateImageRequest, MergeRequest
|
||||
from easydiffusion.utils import log
|
||||
|
||||
import mimetypes
|
||||
|
||||
log.info(f"started in {app.SD_DIR}")
|
||||
log.info(f"started at {datetime.datetime.now():%x %X}")
|
||||
|
||||
@ -52,6 +54,9 @@ class SetAppConfigRequest(BaseModel):
|
||||
|
||||
|
||||
def init():
|
||||
mimetypes.init()
|
||||
mimetypes.add_type('text/css', '.css')
|
||||
|
||||
if os.path.isdir(app.CUSTOM_MODIFIERS_DIR):
|
||||
server_api.mount(
|
||||
"/media/modifier-thumbnails/custom",
|
||||
|
Loading…
Reference in New Issue
Block a user