Skip to content

Thumbnail api call returns original file when thumbnail not available #6240

@qqmyers

Description

@qqmyers

Calling /api/access/datafile/<id>?imageThumb=400 works for file types that have a thumbnail/where a thumbnail can be generated, but it just sends the original file for filetypes for which thumbnails can't be generated. It seems like a 404 would be a better default (avoids downloading large files accidentally and I think it stops the bad thumbnail call from counting a download).
For a quick look, it appears that not being able to create a thumbnail causes the execution to hit this in the Access class:

            } else {
                // Service unknown/not supported/bad arguments, etc.:
                // TODO: throw new ServiceUnavailableException(); 
            }

Unless there are objections, or better ideas, I can look into throwing this exception or otherwise replying with a 404.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions