Support plan
- is this issue currently blocking your project? (yes/no): no
- is this issue affecting a production system? (yes/no): no
Context
- node version: v12.9.0
- module version with issue: @hapi/hapi 19.2.0
- last module version without issue: N/A
- environment (e.g. node, browser, native): node
- used with (e.g. hapi application, another framework, standalone, ...): standalone
- any other relevant information:
What are you trying to achieve or the steps to reproduce?
Configuring a route with route.options.timeout.socket smaller than route.options.payload.timeout
server.route({
method: 'POST',
path: '/',
options: {
payload: {
timeout: 1000
},
timeout: {
socket: 200
}
},
handler: (request, h) => {
return 'Hello World!';
}
});
What was the result you got?
Causes the following error to be throw:
AssertionError [ERR_ASSERTION]: Payload timeout must be shorter than socket timeout
What result did you expect?
I expected to be able to configure the route.options.timeout.socket to be smaller than route.options.payload.timeout. The payload timeout controls the total payload reception time; where-as route.options.timeout.socket is actually the "idle socket timeout", not the "total time socket is open timeout". For example, we should be able to configure the payload to be sent within 1 second, while ensuring that the socket isn't idle for 500ms during the entire duration of the request and response.
Support plan
Context
What are you trying to achieve or the steps to reproduce?
Configuring a route with
route.options.timeout.socketsmaller thanroute.options.payload.timeoutWhat was the result you got?
Causes the following error to be throw:
What result did you expect?
I expected to be able to configure the
route.options.timeout.socketto be smaller thanroute.options.payload.timeout. The payload timeout controls the total payload reception time; where-asroute.options.timeout.socketis actually the "idle socket timeout", not the "total time socket is open timeout". For example, we should be able to configure the payload to be sent within 1 second, while ensuring that the socket isn't idle for 500ms during the entire duration of the request and response.