When using local storage and using a Dockerized Flarum install and where the container port is different to the publically accessible port, file downloads fail due to a curl error: Connection refused. This is because currently the curl request is directed to the full url of the forum, which may not be accessable from inside the container.
After speaking with @clarkwinkelmann it became clear that even for files stored locally, a http request is made within PHP to retrieve the file. I understand that this helps to keep the code simple, however this is bad for two reasons:
The error described above
It creates unneccessary http requests
The downloader should distinguish between local storage and remote, and use file_get_contents for locally available files
When using
local
storage and using a Dockerized Flarum install and where the container port is different to the publically accessible port, file downloads fail due to a curl error:Connection refused
. This is because currently the curl request is directed to the full url of the forum, which may not be accessable from inside the container.After speaking with @clarkwinkelmann it became clear that even for files stored locally, a http request is made within PHP to retrieve the file. I understand that this helps to keep the code simple, however this is bad for two reasons:
The downloader should distinguish between local storage and remote, and use
file_get_contents
for locally available filesFull error: