-
Notifications
You must be signed in to change notification settings - Fork 410
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
[Feature] Allow specifying the HTTP protocol version and version policy #2809
base: dev
Are you sure you want to change the base?
Conversation
…trieving documents.
@microsoft-github-policy-service agree |
Also fixes #1980 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this feature needed?
What are the pain points? What are the scenarios?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting the configuration with HTTP 2 doesn't seem to work and returns this error:
System.Net.Http.HttpRequestException: 'Requesting HTTP version 2.0 with version policy RequestVersionExact while unable to establish HTTP/2 connection.'
I used this test case and set version to 2.0 and policy to RequestVersionExact.
I added #if NET6_0_OR_GREATER
documentRetriever.HttpVersionPolicy = HttpVersionPolicy.RequestVersionExact;
documentRetriever.HttpVersion = new Version(2,0);
#endif after Line 90 and all tests are green for me. |
Hmm. |
I fixed About the HTTP/2 exception, are you behind a corporate firewall which disallows HTTP/2 connections? |
Allow specifying the HTTP protocol version and version policy
Allow specifying the HTTP protocol version and version policy when retrieving documents from eg. discovery endpoints.
Description
The PR allows users of
HttpDocumentRetriever
(for example theConfigurationManager
) to specify the HTTP version and version policy used when sending HTTP requests.The version and policy can bei either specified explicitly via properties on
HttpDocumentRetrieve
or implicitly viaHttpClient
.When using .NET 6 and no explicit values have been set, the default version and policy from the
HttpClient
is used.This allows users of OpenID connect authentication to easily setup the HTTP version and policy by configuring the
HttpClient
of theBackchannel
.Fixes #2808