aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/express-utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-24 15:36:50 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 09:41:54 +0200
commit687d638c2bee0d223f206168173b1b95adbad983 (patch)
tree957741b0ba704562a233181510bb8fda0102c8a5 /server/helpers/express-utils.ts
parentf5b0af50c85e2f8b6b2b054ac1f47123cacbe08d (diff)
downloadPeerTube-687d638c2bee0d223f206168173b1b95adbad983.tar.gz
PeerTube-687d638c2bee0d223f206168173b1b95adbad983.tar.zst
PeerTube-687d638c2bee0d223f206168173b1b95adbad983.zip
Fetch outbox when searching an actor
Diffstat (limited to 'server/helpers/express-utils.ts')
-rw-r--r--server/helpers/express-utils.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/helpers/express-utils.ts b/server/helpers/express-utils.ts
index 1d7bee87e..b715fb7d0 100644
--- a/server/helpers/express-utils.ts
+++ b/server/helpers/express-utils.ts
@@ -95,11 +95,19 @@ function createReqFiles (
95 return multer({ storage }).fields(fields) 95 return multer({ storage }).fields(fields)
96} 96}
97 97
98function isUserAbleToSearchRemoteURI (res: express.Response) {
99 const user: User = res.locals.oauth ? res.locals.oauth.token.User : undefined
100
101 return CONFIG.SEARCH.REMOTE_URI.ANONYMOUS === true ||
102 (CONFIG.SEARCH.REMOTE_URI.USERS === true && user !== undefined)
103}
104
98// --------------------------------------------------------------------------- 105// ---------------------------------------------------------------------------
99 106
100export { 107export {
101 buildNSFWFilter, 108 buildNSFWFilter,
102 getHostWithPort, 109 getHostWithPort,
110 isUserAbleToSearchRemoteURI,
103 badRequest, 111 badRequest,
104 createReqFiles, 112 createReqFiles,
105 cleanUpReqFiles 113 cleanUpReqFiles