fixed wrong regex
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 01:07:10 +01:00
parent 804aa7669b
commit 17a291daa3
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)
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
if not allowed_name.fullmatch(filename):
raise HTTPException(status_code=400, detail="Invalid filename")