adds CORS headers to serveFile #812
1 changed files with 4 additions and 2 deletions
|
@ -6,8 +6,10 @@ const serveFile = ({ filePath, fileType }, res) => {
|
||||||
}
|
}
|
||||||
const sendFileOptions = {
|
const sendFileOptions = {
|
||||||
headers: {
|
headers: {
|
||||||
'X-Content-Type-Options': 'nosniff',
|
'X-Content-Type-Options' : 'nosniff',
|
||||||
'Content-Type' : fileType,
|
'Content-Type' : fileType,
|
||||||
|
'Access-Control-Allow-Origin' : '*',
|
||||||
|
'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
logger.debug(`fileOptions for ${filePath}:`, sendFileOptions);
|
logger.debug(`fileOptions for ${filePath}:`, sendFileOptions);
|
||||||
|
|
Loading…
Reference in a new issue