[BUG]: Active Storage blob redirects do not obey the path in LAGO_API_URL #221
Labels
back end
Back End Linked Issue
Infrastructure
Related to Infrastructure
issue: discussion
A general issue discussion
stale
Describe the bug
I'm serving:
front
) at:https://LAGO_HOSTNAME
(at the root path)api
) athttps://LAGO_HOSTNAME/api
The
api
container receivesLAGO_API_URL=https://LAGO_HOSTNAME/api
, so that it's aware of its own absolute public URL. Likewise, thefront
container receives anAPI_URL
variable with the same value.When downloading an invoice from the frontend:
POST /..../graphql
call to generate it.. which responds with adata.fileUrl
likehttps://LAGO_HOSTNAME/api/rails/active_storage/blobs/redirect/STUFF_HERE/DEV-4911-001-003.pdf
(note the URL having the correct/api
prefix)https://LAGO_HOSTNAME/rails/active_storage/disk/STUFF_HERE/DEV-4911-001-003.pdf
(note the lack of an/api
prefix here)The default docker-compose deployment seems to export the API at its own origin (
http://localhost:3000
). I suppose your hosted deployments put the API on its own domain (api.SOMETHING
). None of these deployments seem to use a subpath for the API, so this kind of usage probably doesn't work perfectly yet.Based on my limited testing (a few hours of playing around with Lago), hosting the API at an
/api
path prefix seems to work. It's just this invoice file redirection thing that fails.The other caveat with exposing the API at
/api
is to only capture requests with/api/
in the URL (not/api
) to avoid capturing the/api-keys.ebbdfaad3d6c7b0d14a7.js
frontend file.The text was updated successfully, but these errors were encountered: