From 5251e8fa5d8f63433e1b4a8180bc84476915ca45 Mon Sep 17 00:00:00 2001 From: Anthony Leung Date: Fri, 5 Jul 2024 10:40:33 +0000 Subject: [PATCH] redirect hangs for 8-9 seconds if connection is not ended --- src/socketify/socketify.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/socketify/socketify.py b/src/socketify/socketify.py index 6ddc68e..a951c5c 100644 --- a/src/socketify/socketify.py +++ b/src/socketify/socketify.py @@ -1666,11 +1666,11 @@ class AppResponse: ) return self - def redirect(self, location, status_code=302): - self.write_status(status_code) - self.write_header("Location", location) - self.end_without_body(False) - return self + def redirect(self, location, status_code=302, end_connection=True): + self.write_status(status_code) + self.write_header("Location", location) + self.end_without_body(end_connection) # warning changing default to True, otherwise redirect hangs for 8-9 seconds + return self def write_offset(self, offset): lib.uws_res_override_write_offset(