IUREDCap / redcap-etl-module

REDCap external module for extracting data from REDCap.
BSD 3-Clause "New" or "Revised" License
9 stars 5 forks source link

web/run.php puts the HTML for refreshing its page into the CVS zip file #44

Open aarenson opened 6 days ago

aarenson commented 6 days ago

After upgrading httpd from 2.4.57 to 2.4.62, web/run.php now appends the HTML response that would normally be rendered by the browser into the CVS file, if one is created.

From what I've, briefly, read, it's not generally expected that a single PHP executable would be able to return more than one set of content. One way to work around this is move the code that generates the Content-Type: application/zip into a second file, and then include a redirect at the end of the HTML to the new, second file. This way the html would be rendered and then the redirect would cause the zip file to be downloaded.

We are holding the update of httpd on our production server until this issue is resolved.

aarenson commented 6 days ago

I suppose it wouldn't strictly HAVE to be in a separate file, but the web/run.php could have logic to either create the CSV file generate its own page.

aarenson commented 6 days ago

I think I've found a one line fix. Add exit(0); after writing out the CSV file and it seems to work.