I've run into a strange issue with this module, and I'm not sure what the best way to approach it is. The basic problem is that a client I'm working with includes files from sites/default/files on their multisite, which isn't playing well with Stage File Proxy.
For example let's call the multisite's files directory sites/multiste/files. On a page, there are references to sites/default/files/my_image.jpg and sites/multiste/files/another_image.jpg. stage_file_proxy_origin_dir is set to "sites/multiste/files".
When the page is loaded, stage_file_proxy_init is called for each file. sites/default/files/my_image.jpg is not downloaded as the public files path for this multisite is sites/multiste/files. If I change stage_file_proxy_origin_dir to sites/default/files, sites/multiste/files/another_image.jpg will not be loaded.
It would make sense to me to then set the stage_file_proxy_origin_dir to "sites", as both files paths are subdirectories of sites. Sadly, if I did that this still wouldn't work since stage_file_proxy_init checks the request URL against the Drupal public files path, which again would be sites/multiste/files in this case. I have a patch that changes stage_file_proxy_init to always check against $remote_file_dir, not $file_dir, which worked in correlation with setting stage_file_proxy_origin_dir to "sites" (I've attached that patch). That said, this does not seem like a super ideal solution as there are Drupal installations with things that aren't files in the sites directory. Another solution that would take a bit more leg-work is letting the module support multiple stage_file_proxy_origin_dirs, where stage_file_proxy_origin_dir could be a path or an array of paths. Not sure how that would be best implemented either.
What's my best option for addressing this issue?