Skip to content

Version 7.0.0 not working with os httphandlers #3907

Closed
@lukapor

Description

@lukapor

If I am using
AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false);
with version 7.0.0 at least Indices api Exists doesnt work correctly. if I am using 7.0.0-beta1 everything is ok.

Here is code to reproduce
static void Main(string[] args)
{
AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false);
var defaultIndex = "nonexist_index";
var pool = new SingleNodeConnectionPool(new Uri("http://localhost:9210"));

var settings = new ConnectionSettings(pool)
    .DefaultIndex(defaultIndex)
    .DisableDirectStreaming()
    .PrettyJson();

var client = new ElasticClient(settings);

var response = client.Indices.Exists(defaultIndex);
if (response.ApiCall.HttpStatusCode != (int)HttpStatusCode.NotFound)
   throw new Exception("Should be 404 status code.");

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions