I have a react 16.8.5 SPA hosted on an IIS 2016 back end on Windows Server 2016. In the app, the user can download a CSV report. To do this, the window.location.href
is set to the URL of the web API that generates the report. For example:
window.location.href = 'api/generatereport'
The API returns a response with a text/csv
content type. This works perfectly in our dev and test environments (the file is downloaded), but fails on the production environment. On the production environment, instead of returning CSV content from the API, HTML is returned that looks suspiciously like index.html. Note that I checked the IIS logs so I know the request never makes it that far. It seems to be a client issue. Also note that the production environment uses https - the others use http.
Any thoughts on what might vary in a production environment that would cause this request to be routed so incorrectly, and only in one environment? Mostly I was looking for a best guess or hunch.