Closed vanboom closed 3 years ago
Upon further investigation, the url
is generated by the storage. So this issue applies to the shirine-google_cloud_storage plugin. Opened an issue here: https://github.com/renchap/shrine-google_cloud_storage/issues/47#issue-960920878
Brief Description
When
url
is called for an attachment stored in Google Cloud Storage for a filename that includes a hash symbol, the URL encoding does not match what Google Cloud is expecting. We realize that this is somewhat of an edge case. The # character should not be used in filenames, but with modern file systems allowing it, please consider adding support in Shrine.Expected behavior
When the filename includes a # symbol, it should be encoded as part of the filename and not an anchor.
e.g. "my#file.pdf" -> "my%23file.pdf"
Actual behavior
Shrine does not URL encode the file name portion of the download URL...
Simplest self-contained example code to demonstrate issue
System configuration
Ruby version:
2.5.0
Shrine version:
3.4.0
shrine-google_cloud_storage:1.34.1
Thanks for your consideration - I will attempt a PR if I can figure it out.