Fix error message for image access. (#3936)

### What problem does this PR solve?

#3883

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2024-12-09 15:24:58 +08:00
committed by GitHub
parent 044afa83d1
commit afe82feb57
3 changed files with 12 additions and 6 deletions

View File

@ -498,6 +498,9 @@ def change_parser():
# @login_required
def get_image(image_id):
try:
arr = image_id.split("-")
if len(arr) != 2:
return get_data_error_result(message="Image not found.")
bkt, nm = image_id.split("-")
response = flask.make_response(STORAGE_IMPL.get(bkt, nm))
response.headers.set('Content-Type', 'image/JPEG')