X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fwell-known.ts;h=ce5883571cf66e1f7961f9f08f53c57b9e322fe5;hb=3a380e9a71037b0fcbace58a7599221e7cc76e20;hp=f467bd629835e2299b922b8d7a6c6a14899b0f35;hpb=ea8107bff8e544594716a76d30ff372fc80d755c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/well-known.ts b/server/controllers/well-known.ts index f467bd629..ce5883571 100644 --- a/server/controllers/well-known.ts +++ b/server/controllers/well-known.ts @@ -5,6 +5,7 @@ import { root } from '@shared/core-utils' import { CONFIG } from '../initializers/config' import { ROUTE_CACHE_LIFETIME, WEBSERVER } from '../initializers/constants' import { cacheRoute } from '../middlewares/cache/cache' +import { handleStaticError } from '@server/middlewares' const wellKnownRouter = express.Router() @@ -69,6 +70,12 @@ wellKnownRouter.use('/.well-known/host-meta', } ) +wellKnownRouter.use('/.well-known/', + cacheRoute(ROUTE_CACHE_LIFETIME.WELL_KNOWN), + express.static(CONFIG.STORAGE.WELL_KNOWN_DIR, { fallthrough: false }), + handleStaticError +) + // --------------------------------------------------------------------------- export {