Overwrite asset_url from tenant middleware?
Is it possible to overwrite the config urls, so I can avoid cors errors?
So far I tried this, but I assume tenantMiddleware is called too late or something else?
6 Replies
Just to clerify the main issue with this comes from when I use FileUpload and the image fails to load due to CORS.
You can set the config in the tenant middleware
so say:
Then set the panel config here?
What am I supposed to set to the panel? I don't think i can do anything useful with it from what I can see
If you don't set the asset_url it should fallback to the current host are you not seeing that
from my manual test editing .env, livewire only cares about the APP_URL
it never uses ASSET_URL
but then again dumping the config in the resource returns the correct url, but livewire keeps using the env one
im starting to think this is not filament issue but more livewire?
Yeah, i will just move it to use the domain from $request so i can avoid using tenantMiddleware
this seems to fix the issue and uses now the updated values
Great