The previous approach was wrong and could lead to wrong timeout values getting used. Reported-by: bsr13 on hackerone Closes #17184