Merge pull request from jessopb/CORS

adds CORS headers to serveFile
This commit is contained in:
Shawn K 2018-12-06 20:55:33 -06:00 committed by GitHub
commit c371550bf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);