usnistgov / oar-pdr

The NIST Open Access to Research (OAR) Public Data Repository (PDR) system software
11 stars 10 forks source link

mdserver: fix renaming of files downloaded from publishing platform #175

Closed RayPlante closed 3 years ago

RayPlante commented 3 years ago

This PR addresses ODD-953 ("Datapub direct file download") which observes that files downloaded via the proto-landing page on the publishing platform (datapub) are being saved with names of the form, download.*. A related symptom is that files with a comma in the name fail to download with the browser reporting a "Network error". This is due to an incorrect format for the value being set for the Content-Disposition HTTP Header by the metadata server. This corrects the value by setting it to inline; filename="filename".

RayPlante commented 3 years ago

As this is a super minor change that addresses a recent user issue on a pending publication, I'm going to treat this as a hot fix to datapub and skip review. I've deployed and tested under oar-docker both locally and on datapubtest. Downloading files with commas in the names is now possible, and downloaded files are now automatically being saved with their original name from the server.