Closed MarkOates closed 7 years ago
For some reason, CarrierWave and S3 like to generate really nasty URLs that look like this:
https://allegro-planet.s3.amazonaws.com/screenshots/krampus_shot_3.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIB5BMVW4AB8A%9201456704%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20170305T055242Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=f4aeab5df7dba2a875b4c77ae8b99a9a32cc17ae9bbbd6ca1bc0
Clean up the URLs by adding a #public_url method directly on the models for GameFile and GameScreenshot. Now URLs would look like this:
#public_url
GameFile
GameScreenshot
https://allegro-planet.s3.amazonaws.com/screenshots/krampus_shot_3.png
Problem
For some reason, CarrierWave and S3 like to generate really nasty URLs that look like this:
Solution
Clean up the URLs by adding a
#public_url
method directly on the models forGameFile
andGameScreenshot
. Now URLs would look like this: