added missing allowed underscore
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Hipstercat <tasty@hipstercat.fr>
This commit is contained in:
parent
4c90805a38
commit
6440ecf73b
@ -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