Skip to content

Commit

Permalink
fix: send proper close connection on local webserver redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
yeisonvargasf committed Feb 19, 2025
1 parent 3de59d8 commit eff3188
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion safety/auth/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ def do_redirect(self, location: str, params: Dict) -> None:
location (str): The URL to redirect to.
params (dict): Additional parameters for the redirection.
"""
self.send_response(301)
self.send_response(302)
self.send_header('Location', location)
self.send_header('Connection', 'close')
self.send_header('Cache-Control', 'no-store, no-cache, must-revalidate')
self.end_headers()

def log_message(self, format: str, *args: Any) -> None:
Expand Down

0 comments on commit eff3188

Please sign in to comment.