mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +00:00
Multi-domain fixes. Maybe it's ready?
This commit is contained in:
parent
aae56e91c9
commit
d6c7aff21b
@ -56,11 +56,14 @@ uploadsController.upload = function(req, res, next){
|
|||||||
|
|
||||||
db.table('files').insert(files).then(() => {
|
db.table('files').insert(files).then(() => {
|
||||||
|
|
||||||
let basedomain = req.get('host') + '/'
|
console.log('basedomain: ' + req.get('host'))
|
||||||
|
let basedomain = req.get('host')
|
||||||
for(let domain of config.domains)
|
for(let domain of config.domains)
|
||||||
if(domain.host === req.get('host'))
|
if(domain.host === req.get('host'))
|
||||||
if(domain.hasOwnProperty('resolve'))
|
if(domain.hasOwnProperty('resolve'))
|
||||||
return basedomain = domain.resolve + '/'
|
basedomain = domain.resolve
|
||||||
|
|
||||||
|
console.log('basedomain: ' + basedomain)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
success: true,
|
success: true,
|
||||||
@ -68,7 +71,7 @@ uploadsController.upload = function(req, res, next){
|
|||||||
return {
|
return {
|
||||||
name: file.name,
|
name: file.name,
|
||||||
size: file.size,
|
size: file.size,
|
||||||
url: basedomain + file.name
|
url: 'http://' + basedomain + '/' + file.name
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user