From b645d74b8fa42508e81554208f7b8abc3bf48147 Mon Sep 17 00:00:00 2001 From: Jiri Kalvoda <jirikalvoda@kam.mff.cuni.cz> Date: Fri, 28 Oct 2022 01:21:49 +0200 Subject: [PATCH] Module: Http: allow redirects --- Module.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Module.cs b/Module.cs index a979c78..73969df 100644 --- a/Module.cs +++ b/Module.cs @@ -365,9 +365,13 @@ text = ERR { if(client != null) client.Dispose(); - client = new HttpClient(); + var handler = new HttpClientHandler() + { + AllowAutoRedirect = false + }; + client = new HttpClient(handler); client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36"); - client.Timeout = TimeSpan.FromMilliseconds(10000); + client.Timeout = TimeSpan.FromMilliseconds(10000); } reloadClient(); while(true) -- GitLab