diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/express-utils.ts | 8 |
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 | ||
98 | function 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 | ||
100 | export { | 107 | export { |
101 | buildNSFWFilter, | 108 | buildNSFWFilter, |
102 | getHostWithPort, | 109 | getHostWithPort, |
110 | isUserAbleToSearchRemoteURI, | ||
103 | badRequest, | 111 | badRequest, |
104 | createReqFiles, | 112 | createReqFiles, |
105 | cleanUpReqFiles | 113 | cleanUpReqFiles |