It keeps loading after download

Expected behavior

download file and return successful status 204

Actual behavior

file downloaded but the banner remained blue (loading) “download project is executing”

Failure logs

none

Context

  • “express”: “~4.17.1”,
  • “express-jwt”: “6.0.0”,
  • “forest-express-mongoose”: “^8.0.0”,
  • “mongoose”: “~5.8.2”,
  • Project Name: simulationService
  • database: mongodb

smart action:

{
  name: "Download Project",
  type: "single",
  download: true,
},

post request:

let result = (await axios.get(url, config)).data; // json data
let filename = projectId + ".json"; // filename based on a variable

res.set({
  "Access-Control-Expose-Headers": "Content-Disposition",
  "Content-Disposition": `attachment; filename="${filename}"`,
  "Content-Type": "application/json",
});

return res.send(result);