Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Middleware] Move to GenericHost #23626

Merged
merged 20 commits into from
Jul 8, 2020
Merged

[Middleware] Move to GenericHost #23626

merged 20 commits into from
Jul 8, 2020

Conversation

BrennanConroy
Copy link
Member

@BrennanConroy BrennanConroy commented Jul 2, 2020

Part of #20964

Each Middleware has its own commit

Edit:
Disposing the IHost for all tests is in the last commit, sorry did it as an after the fact change so it's not separated by area.

@BrennanConroy BrennanConroy marked this pull request as ready for review July 7, 2020 00:32
@Tratcher Tratcher requested a review from JunTaoLuo July 7, 2020 20:25
{
var client = server.CreateClient();
client.DefaultRequestHeaders.AcceptLanguage.ParseAdd("jp,ar-SA,en-US");
var count = client.DefaultRequestHeaders.AcceptLanguage.Count;
var response = await client.GetAsync(string.Empty);
Assert.Equal(3, count);
}

await host.StopAsync();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remind me why you had to call stop? Why isn't Dispose good enough?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember exactly, I think this was the issue where memory blocks were not being disposed which breaks in debug.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's only an issue in Kestrel and SignalR (?), not TestServer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah true, only if you use Kestrel. Want me to remove the StopAsync's then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove a few just to confirm it works without them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work fine. I'll remove them.

@BrennanConroy BrennanConroy merged commit f1dd68f into master Jul 8, 2020
@BrennanConroy BrennanConroy deleted the brecon/middle branch July 8, 2020 00:32
@amcasey amcasey added the area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants