WL-3163 Fix for bad merge which introduced redirect.

The code had an initial redirect which was always getting called so this then caused the outputting of the CSV to be failing because the headers were already written.