I am successfully using the pre-finish hook to set the correct Content Type on the uploaded file, and would like to return a success indicator to the client. I am able to set a response header value (X-Content-Type-Set: “True|False”), and can see it in the network tab as expected.
However, when I try to use onAfterResponse to header the header value:
onAfterResponse: (req, res) => {
console.log(res.getHeader("X-Content-Type-Set"));
},
I get an error message from Chrome saying “Refused to get unsafe header”.
Is there any way for me to get this header value? Or is there any way for me to set information in the pre-finish hook that the client can receive? I would use ChangeFileInfo to add it to the metadata, but ChangeFileInfo is only relevant to the pre-upload hook.