mime types updated
parent
c9923cbca1
commit
5e9bce2039
2
app.py
2
app.py
|
@ -568,7 +568,7 @@ def generateimages():
|
|||
ai_art_tools_l = []
|
||||
accepted_filetypes = []
|
||||
for k, v in mime_types.items():
|
||||
if v not in accepted_filetypes:
|
||||
if v not in accepted_filetypes and 'text/html' not in k:
|
||||
accepted_filetypes.append(v)
|
||||
for k, v in ai_art_tools.items():
|
||||
ai_art_tools_l.append(f'◦ <a href="{v}" target="_blank">{k}</a><br>')
|
||||
|
|
5
game.py
5
game.py
|
@ -55,10 +55,14 @@ file_upload = {
|
|||
|
||||
mime_types = {
|
||||
'image/png': 'png',
|
||||
'image/png, image/png': 'png',
|
||||
'image/jpeg': 'jpeg',
|
||||
'image/jpeg, image/jpeg': 'jpeg',
|
||||
'image/jpg': 'jpeg',
|
||||
'image/jpg, image/jpg': 'jpeg',
|
||||
# 'image/gif': 'gif',
|
||||
'image/webp': 'webp',
|
||||
'image/webp, image/web': 'webp',
|
||||
'text/html': 'text',
|
||||
'text/html; charset=utf-8': 'text',
|
||||
}
|
||||
|
@ -597,7 +601,6 @@ def validate_image_url(url:str, file_upload:dict)->tuple:
|
|||
if b32 in url:
|
||||
s_url = url.split(f'{b32}/')
|
||||
if len(s_url) > 1:
|
||||
print('yes')
|
||||
try:
|
||||
# filetype = s_url[1].split('.')[1]
|
||||
fname_, filetype = os.path.splitext(url)
|
||||
|
|
Loading…
Reference in New Issue