1
0
Fork 0

Fix peertube on chrome

This commit is contained in:
Chocobozzz 2018-07-26 16:45:47 +02:00
parent a5d379d305
commit 3ac046e2a4
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 1 additions and 32 deletions

View File

@ -53,39 +53,8 @@ app.set('trust proxy', CONFIG.TRUST_PROXY)
app.use(helmet({
frameguard: {
action: 'deny' // we only allow it for /videos/embed, see server/controllers/client.ts
},
dnsPrefetchControl: {
allow: true
},
contentSecurityPolicy: {
directives: {
defaultSrc: ['*', 'data:', REMOTE_SCHEME.WS + ':', REMOTE_SCHEME.HTTP + ':'],
fontSrc: ["'self'", 'data:'],
frameSrc: ["'none'"],
mediaSrc: ['*', REMOTE_SCHEME.HTTP + ':'],
objectSrc: ["'none'"],
scriptSrc: ["'self'", "'unsafe-inline'", "'unsafe-eval'"],
styleSrc: ["'self'", "'unsafe-inline'"],
upgradeInsecureRequests: false
},
browserSniff: false // assumes a modern browser, but allows CDN in front
},
referrerPolicy: {
policy: 'strict-origin-when-cross-origin'
}
}))
app.use((_, res, next) => {
[
"vibrate 'none'",
"geolocation 'none'",
"camera 'none'",
"microphone 'none'",
"magnetometer 'none'",
"payment 'none'",
"accelerometer 'none'"
].forEach(e => res.append('Feature-Policy', e + ';'))
next()
})
// ----------- Database -----------

View File

@ -287,7 +287,7 @@ async function createRates (actorUrls: string[], video: VideoModel, rate: VideoR
logger.info('Adding %d %s to video %s.', rateCounts, rate, video.uuid)
// This is "likes" and "dislikes"
await video.increment(rate + 's', { by: rateCounts })
if (rateCounts !== 0) await video.increment(rate + 's', { by: rateCounts })
return
}