clowder-framework / clowder

A data management system that allows users to share, annotate, organize and analyze large collections of datasets. It provides support for extensible metadata annotation using JSON-LD and a distribute analytics event bus for automatic curation of uploaded data.
https://clowderframework.org/
University of Illinois/NCSA Open Source License
34 stars 17 forks source link

HTML preview return pv_route point to /clowder/ instead of /clowder/api #393

Open longshuicy opened 1 year ago

longshuicy commented 1 year ago

Describe the bug When using the endpoint /clowder/api/files/{file_id}/getPreviews to request previews, I was using the returned pv_route to GET subsequent preview file. This works for video and audio.

image image

However for html preview, the return pv_route point to the non-api endpoint. Which makes it not possible for another client to request.

image

The fix would be just simply add /api/ in the routes to match the other pattern. e.g. when the above pv_route become /clowder/api/files/63561e18e4b0bf4d8ee3a677/blob then I am able to use API key to request this file blob

To Reproduce Steps to reproduce the behavior:

  1. Use POSTman or any other client to request GET https://clowder.ncsa.illinois.edu/clowder/api/files/6360313ae4b068f7f078cc92/getPreviews
  2. Check the response, specifically the pv_route in the response body.