Using X-Sendfile for downloads

Hey, I'm trying to bypass the self-hosted file downloads to pass it off to X-Sendfile on my server. I've had it working in older versions of s2member by hacking it into the plugin, but I obviously want to do this through an action hook instead.
Looking at classes/files-in.inc.php it looks like files are downloaded towards the end of 'c_ws_plugin__s2member_files_in::check_file_download_access', but I'm not seeing something I can plug into without clobbering all the file checking.
Ideally, I'd like to replace all the file headers in line #331
Any suggestions on accomplishing that?
Looking at classes/files-in.inc.php it looks like files are downloaded towards the end of 'c_ws_plugin__s2member_files_in::check_file_download_access', but I'm not seeing something I can plug into without clobbering all the file checking.
Ideally, I'd like to replace all the file headers in line #331
- Code: Select all
else /* Else, ``if ($serving)`` , use local storage option (default).*/
- Code: Select all
header("X-Sendfile: $file_path");
Any suggestions on accomplishing that?