Signed-off-by: Hipstercat <tasty@hipstercat.fr>
This commit is contained in:
parent
804aa7669b
commit
17a291daa3
@ -42,7 +42,7 @@ async def get_map_by_crc(human_crc: Optional[str] = Query(None, min_length=8, ma
|
|||||||
|
|
||||||
@router.post("/maps", tags=["maps"], response_model=MapOut)
|
@router.post("/maps", tags=["maps"], response_model=MapOut)
|
||||||
async def upload_map(map_in: MapIn):
|
async def upload_map(map_in: MapIn):
|
||||||
allowed_name = re.compile("[a-zA-Z-.\d()[] ]+.gck")
|
allowed_name = re.compile("[a-zA-Z-.\d\(\)\[\] ]+.gck")
|
||||||
filename = map_in.name
|
filename = map_in.name
|
||||||
if not allowed_name.fullmatch(filename):
|
if not allowed_name.fullmatch(filename):
|
||||||
raise HTTPException(status_code=400, detail="Invalid filename")
|
raise HTTPException(status_code=400, detail="Invalid filename")
|
||||||
|
Loading…
Reference in New Issue
Block a user