aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-29 10:58:24 +0200
committerChocobozzz <me@florianbigard.com>2018-03-29 11:03:30 +0200
commit490b595a01c5824ff63ffb87f0efdfca95f4bf3b (patch)
tree3ad716fbb97a8b4ee946ad907202b82934a33d7c /server.ts
parent23f4c3d412974fa5fda52589d1192e098e260f1a (diff)
downloadPeerTube-490b595a01c5824ff63ffb87f0efdfca95f4bf3b.tar.gz
PeerTube-490b595a01c5824ff63ffb87f0efdfca95f4bf3b.tar.zst
PeerTube-490b595a01c5824ff63ffb87f0efdfca95f4bf3b.zip
Prevent brute force login attack
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/server.ts b/server.ts
index f6794b897..b307e67a1 100644
--- a/server.ts
+++ b/server.ts
@@ -48,6 +48,9 @@ if (errorMessage !== null) {
48 throw new Error(errorMessage) 48 throw new Error(errorMessage)
49} 49}
50 50
51// Trust our proxy (IP forwarding...)
52app.set('trust proxy', CONFIG.TRUST_PROXY)
53
51// ----------- Database ----------- 54// ----------- Database -----------
52 55
53// Initialize database and models 56// Initialize database and models
@@ -81,6 +84,7 @@ if (isTestInstance()) {
81 ) { 84 ) {
82 return (cors({ 85 return (cors({
83 origin: 'http://localhost:3000', 86 origin: 'http://localhost:3000',
87 exposedHeaders: 'Retry-After',
84 credentials: true 88 credentials: true
85 }))(req, res, next) 89 }))(req, res, next)
86 } 90 }