diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/config.ts | 4 | ||||
-rw-r--r-- | server/controllers/api/search/search-video-channels.ts | 4 | ||||
-rw-r--r-- | server/controllers/client.ts | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index d542f62aa..5ea1f67c9 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -11,7 +11,7 @@ import { objectConverter } from '../../helpers/core-utils' | |||
11 | import { CONFIG, reloadConfig } from '../../initializers/config' | 11 | import { CONFIG, reloadConfig } from '../../initializers/config' |
12 | import { ClientHtml } from '../../lib/client-html' | 12 | import { ClientHtml } from '../../lib/client-html' |
13 | import { asyncMiddleware, authenticate, ensureUserHasRight, openapiOperationDoc } from '../../middlewares' | 13 | import { asyncMiddleware, authenticate, ensureUserHasRight, openapiOperationDoc } from '../../middlewares' |
14 | import { customConfigUpdateValidator } from '../../middlewares/validators/config' | 14 | import { customConfigUpdateValidator, ensureConfigIsEditable } from '../../middlewares/validators/config' |
15 | 15 | ||
16 | const configRouter = express.Router() | 16 | const configRouter = express.Router() |
17 | 17 | ||
@@ -38,6 +38,7 @@ configRouter.put('/custom', | |||
38 | openapiOperationDoc({ operationId: 'putCustomConfig' }), | 38 | openapiOperationDoc({ operationId: 'putCustomConfig' }), |
39 | authenticate, | 39 | authenticate, |
40 | ensureUserHasRight(UserRight.MANAGE_CONFIGURATION), | 40 | ensureUserHasRight(UserRight.MANAGE_CONFIGURATION), |
41 | ensureConfigIsEditable, | ||
41 | customConfigUpdateValidator, | 42 | customConfigUpdateValidator, |
42 | asyncMiddleware(updateCustomConfig) | 43 | asyncMiddleware(updateCustomConfig) |
43 | ) | 44 | ) |
@@ -46,6 +47,7 @@ configRouter.delete('/custom', | |||
46 | openapiOperationDoc({ operationId: 'delCustomConfig' }), | 47 | openapiOperationDoc({ operationId: 'delCustomConfig' }), |
47 | authenticate, | 48 | authenticate, |
48 | ensureUserHasRight(UserRight.MANAGE_CONFIGURATION), | 49 | ensureUserHasRight(UserRight.MANAGE_CONFIGURATION), |
50 | ensureConfigIsEditable, | ||
49 | asyncMiddleware(deleteCustomConfig) | 51 | asyncMiddleware(deleteCustomConfig) |
50 | ) | 52 | ) |
51 | 53 | ||
diff --git a/server/controllers/api/search/search-video-channels.ts b/server/controllers/api/search/search-video-channels.ts index 25173ac20..089feed65 100644 --- a/server/controllers/api/search/search-video-channels.ts +++ b/server/controllers/api/search/search-video-channels.ts | |||
@@ -47,7 +47,7 @@ export { searchChannelsRouter } | |||
47 | 47 | ||
48 | function searchVideoChannels (req: express.Request, res: express.Response) { | 48 | function searchVideoChannels (req: express.Request, res: express.Response) { |
49 | const query = pickSearchChannelQuery(req.query) | 49 | const query = pickSearchChannelQuery(req.query) |
50 | let search = query.search || '' | 50 | const search = query.search || '' |
51 | 51 | ||
52 | const parts = search.split('@') | 52 | const parts = search.split('@') |
53 | 53 | ||
@@ -58,7 +58,7 @@ function searchVideoChannels (req: express.Request, res: express.Response) { | |||
58 | if (isURISearch(search) || isWebfingerSearch) return searchVideoChannelURI(search, isWebfingerSearch, res) | 58 | if (isURISearch(search) || isWebfingerSearch) return searchVideoChannelURI(search, isWebfingerSearch, res) |
59 | 59 | ||
60 | // @username -> username to search in DB | 60 | // @username -> username to search in DB |
61 | if (search.startsWith('@')) search = search.replace(/^@/, '') | 61 | if (search.startsWith('@')) query.search = search.replace(/^@/, '') |
62 | 62 | ||
63 | if (isSearchIndexSearch(query)) { | 63 | if (isSearchIndexSearch(query)) { |
64 | return searchVideoChannelsIndex(query, res) | 64 | return searchVideoChannelsIndex(query, res) |
diff --git a/server/controllers/client.ts b/server/controllers/client.ts index cdc556da2..86ac5fbbc 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts | |||
@@ -65,7 +65,10 @@ const staticClientOverrides = [ | |||
65 | 'assets/images/icons/icon-96x96.png', | 65 | 'assets/images/icons/icon-96x96.png', |
66 | 'assets/images/icons/icon-144x144.png', | 66 | 'assets/images/icons/icon-144x144.png', |
67 | 'assets/images/icons/icon-192x192.png', | 67 | 'assets/images/icons/icon-192x192.png', |
68 | 'assets/images/icons/icon-512x512.png' | 68 | 'assets/images/icons/icon-512x512.png', |
69 | 'assets/images/default-playlist.jpg', | ||
70 | 'assets/images/default-avatar-account.png', | ||
71 | 'assets/images/default-avatar-video-channel.png' | ||
69 | ] | 72 | ] |
70 | 73 | ||
71 | for (const staticClientOverride of staticClientOverrides) { | 74 | for (const staticClientOverride of staticClientOverrides) { |