I have some publicly available files in a google cloud storage bucket, the links are on a static site. I'd like to log when a user downloads the files, whilst making the link behave like a normal download link.
My initial idea is to use the link to call a cloud function and pass it the object name. The cloud function can do whatever logging logic it needs to, and also pass the file to the client.
My question is about how to pass the file to the client as if they'd just clicked on a normal download link. I think I need to insert some headers, maybe?