Skip to content

Commit

Permalink
Merge pull request #225 from nih-sparc/Add-file-size-check-to-segment…
Browse files Browse the repository at this point in the history
…ation-info-endpoint

Added file size check to segmentation info endpoint
  • Loading branch information
egauzens authored Jul 18, 2024
2 parents c9d6301 + 0366869 commit 00d3f3a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,11 @@ def get_segmentation_info_from_file(bucket_name=Config.DEFAULT_S3_BUCKET_NAME):
dataset_path = query_args.get('dataset_path')

try:
# Check the header to see if too large
response = s3_header_check(dataset_path, s3BucketName)
# Check if file exists
if response[0] == 404:
abort(404, description=f'Provided path was not found on the s3 resource')
response = s3.get_object(
Bucket=s3BucketName,
Key=dataset_path,
Expand Down

0 comments on commit 00d3f3a

Please sign in to comment.