added missing allowed underscore
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Hipstercat <tasty@hipstercat.fr>
This commit is contained in:
Amazed 2021-12-23 22:55:56 +01:00
parent 4c90805a38
commit 6440ecf73b
Signed by: hipstercat
GPG Key ID: BF42C937290F5641

View File

@ -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")