Skip to content

FollowRedirects not working #2045

Description

@rawensoft

If 'FollowRedirects = true', the request completion code is 'StatusCode: Found', but 'StatusCode: OK' is expected. Changing 'FollowRedirects = false' does nothing.

var client = new RestClient(new RestClientOptions()
{
AutomaticDecompression = DecompressionMethods.All,
FollowRedirects = true,
MaxRedirects = 10,
UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36",
BaseUrl = new Uri("https://steamcommunity.com/market/eligibilitycheck/?goto=%2Fmy%2Ftradeoffers%2Fprivacy"),
AllowMultipleDefaultParametersWithSameName = true,
Proxy = proxy,
RemoteCertificateValidationCallback = (sender, cert, chain, sslPolicyErrors) => { return true; }
});
var container = new CookieContainer();
/*
* Add a steam cookie to container
*/
var request = new RestRequest(string.Empty, Method.Get) { CookieContainer = container };
request.AddHeader("Accept", "*/*");
request.AddHeader("DNT", "1");
request.AddHeader("Upgrade-Insecure-Requests", "1");
request.Timeout = 20000;
var response = await client.ExecuteAsync(req);
  • OS: Windows 10 Pro 22H2 19045.2788
  • .NET version 6
  • Version 109 & 110

Same code on version 108.0.3 works as expected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-feedbackNeed feedback after the issue is fixed in previewbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions