Skip to content

Behavioral difference between Linux and Windows in httprequest with 302 reply and # #25119

Closed
dotnet/corefx
#27360
@Petermarcu

Description

@Petermarcu

@jdelrue commented on Thu Feb 01 2018

General

Operating system 1: Windows 10
Operating system 2: Ubuntu (16.04 or 17.04)

Execute:

using System;
using System.Net.Http;
using System.Threading.Tasks;

namespace redirtest
{
    class Program
    {
        static void Main(string[] args)
        {
            var res = Task.Run(async () => await method());
            res.Wait();
        }
        public static async Task method()
        {
            using (var client = new HttpClient(new HttpClientHandler
            {
                AllowAutoRedirect = true
            }))
            {
                var connect = await client.GetAsync("http://www.jimber.org/redirect.php");
                var requestUri = connect.RequestMessage.RequestUri.AbsoluteUri;
                Console.WriteLine(requestUri);

            }
        }
    }
}

Output Windows: http://www.google.be/#youdontgetthisinlinux
Output Linux: http://www.google.be/

Expected output is the Windows version. Workaround: Disable autoredirect and read location header.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions