Fixed two variable names to match old es5 var-names.
This commit is contained in:
parent
eeec5004f2
commit
523b8457e6
1 changed files with 5 additions and 4 deletions
|
@ -1,16 +1,17 @@
|
||||||
const errorHandlers = require('../helpers/libraries/errorHandlers.js')
|
const errorHandlers = require('../helpers/libraries/errorHandlers.js')
|
||||||
const serveController = require('../controllers/serveController.js')
|
const serveController = require('../controllers/serveController.js')
|
||||||
|
|
||||||
function serveFile ({ fileType, filePath }, res) {
|
function serveFile ({ file_type, file_path }, res) {
|
||||||
// set default options
|
// set default options
|
||||||
const options = {
|
const options = {
|
||||||
headers: {
|
headers: {
|
||||||
'X-Content-Type-Options': 'nosniff',
|
'X-Content-Type-Options': 'nosniff',
|
||||||
'Content-Type' : fileType,
|
'Content-Type' : file_type,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
// adjust default options as needed
|
// adjust default options as needed
|
||||||
switch (fileType) {
|
// eslint-disable-next-line camelcase
|
||||||
|
switch (file_type) {
|
||||||
case 'image/jpeg':
|
case 'image/jpeg':
|
||||||
break
|
break
|
||||||
case 'image/gif':
|
case 'image/gif':
|
||||||
|
@ -25,7 +26,7 @@ function serveFile ({ fileType, filePath }, res) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// send file
|
// send file
|
||||||
res.status(200).sendFile(filePath, options)
|
res.status(200).sendFile(file_path, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = (app, ua, googleAnalyticsId) => {
|
module.exports = (app, ua, googleAnalyticsId) => {
|
||||||
|
|
Loading…
Reference in a new issue