diff --git a/src/index.ts b/src/index.ts index 58be268..8f1cf9a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,17 @@ export default { * * This gives you an opportunity to extend code. */ - register(/* { strapi }: { strapi: Core.Strapi } */) {}, + // register(/* { strapi }: { strapi: Core.Strapi } */) {}, + + register({ strapi }) { + // Force the socket to be treated as encrypted for proxy setups + strapi.server.use(async (ctx, next) => { + if (ctx.req?.socket) { + (ctx.req.socket as any).encrypted = true; + } + await next(); + }); + }, /** * An asynchronous bootstrap function that runs before