violet_rails icon indicating copy to clipboard operation
violet_rails copied to clipboard

RCA: Image/video not being rendered of api-resource in Heroku

Open alis-khadka opened this issue 3 years ago • 0 comments

The image/video file are not being rendered in heroku. image

In the image above, we can see that url for the image (http://public.herokuapp.com/rails/active_storage/blobs/redirect...) is invalid. The domain is incorrect in the url.

For heroku, we have the url: violetrails.herokuapp.com. This is without the subdomain in the url. Generally, the domain length is 1 but for heroku, it is 2. Below is a code snippet run in heroku's rails console. image

For the root domain in heroku, the url will work if we change it from http://public.herokuapp.com to http://violetrails.herokuapp.com/.

https://user-images.githubusercontent.com/25191509/186481776-80cb48de-0ccd-4976-878f-7ad10c378fa8.mp4

P.S. If we use the url: http://public.violetrails.herokuapp.com/, it will not work with the subdomain detail. This issue is yet to be figured out.

alis-khadka avatar Aug 24 '22 17:08 alis-khadka