feat: allow passing http serverOptions from config (#18591)

This commit is contained in:
Ben Irvin 2023-11-06 15:31:17 +01:00 committed by GitHub
parent 84033819f8
commit 87431e44c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -21,4 +21,9 @@ module.exports = ({ env }) => ({
},
// http_proxy is the env var used by system to set proxy globally
globalProxy: env('http_proxy'),
http: {
serverOptions: {
requestTimeout: 1000 * 60 * 10, // set request timeout to 600000ms (10 minutes)
},
},
});

View File

@ -20,7 +20,9 @@ const createHTTPServer = (strapi: Strapi, koaApp: Koa): Server => {
return handler(req, res);
};
const server: http.Server = http.createServer(listener);
const options = strapi.config.get<http.ServerOptions>('server.http.serverOptions', {});
const server: http.Server = http.createServer(options, listener);
server.on('connection', (connection) => {
connections.add(connection);