Increased the maximum filename limit to 255. No consistent with the DB and standards.

This commit is contained in:
Scott Idem
2024-05-22 15:54:47 -04:00
parent a8aa6bf950
commit 6c5b120526
3 changed files with 6 additions and 6 deletions

View File

@@ -239,7 +239,7 @@ async def event_file_lookup(
@router.get('/event/file/{event_file_id}/download', response_model=Resp_Body_Base)
async def download_event_file(
event_file_id: str = Path(min_length=11, max_length=22),
filename: str = Query(None, min_length=4, max_length=100),
filename: str = Query(None, min_length=4, max_length=255),
streaming: bool = False,
commons: Common_Route_Params = Depends(common_route_params),

View File

@@ -161,7 +161,7 @@ async def directory_check(
@router.get('/{hosted_file_id}/download', response_model=Resp_Body_Base)
async def download_hosted_file(
hosted_file_id: str = Path(min_length=11, max_length=22),
filename: str = Query(None, min_length=4, max_length=100),
filename: str = Query(None, min_length=4, max_length=255),
# streaming: bool = False,
commons: Common_Route_Params = Depends(common_route_params),
@@ -248,7 +248,7 @@ async def file_streamer(path: str, start: int, end: int):
@router.get('/{hosted_file_id}/stream')
async def stream_hosted_file(
hosted_file_id: str = Path(min_length=11, max_length=22),
filename: str = Query(None, min_length=4, max_length=100),
filename: str = Query(None, min_length=4, max_length=255),
# streaming: bool = True,
range: str = Header(),
@@ -956,7 +956,7 @@ async def check_hosted_file_obj_w_hash(
@router.get('/tmp/{subdirectory}/{filename}/download', response_model=Resp_Body_Base)
async def download_tmp(
subdirectory: str = Path(min_length=1, max_length=100),
filename: str = Path(min_length=4, max_length=120),
filename: str = Path(min_length=4, max_length=255),
commons: Common_Route_Params = Depends(common_route_params),
):
@@ -1002,7 +1002,7 @@ async def convert_file(
link_to_id: str = Query(..., min_length=11, max_length=22),
# filename: str = Query('automatic_pdf_to_img_conversion.webp', min_length=2, max_length=150),
filename_no_ext: str = Query('automated_hosted_file_conversion', min_length=1, max_length=150),
filename_no_ext: str = Query('automated_hosted_file_conversion', min_length=1, max_length=240), # Intentionally below 255 characters to account for the extension
# extension: str = Query('webp', min_length=1, max_length=15),
from_type: str = 'pdf',

View File

@@ -28,7 +28,7 @@ async def get_qr(
account_id: str = Path(min_length=11, max_length=22),
regen: bool = False,
qr_type: str = Query(None, min_length=1, max_length=10),
filename: str = Query(None, min_length=4, max_length=100),
filename: str = Query(None, min_length=4, max_length=255),
n: str = Query('', max_length=100),
fn: str = Query('', max_length=100),