Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ValidateAndNormalizeRequest()

Exception System.Net.Http.SocketsHttpHandler.ValidateAndNormalizeRequest ( HttpRequestMessage request)
inlineprivate

Definition at line 556 of file SocketsHttpHandler.cs.

557 {
558 if (request.Version.Major == 0)
559 {
560 return new NotSupportedException(System.SR.net_http_unsupported_version);
561 }
562 if (request.HasHeaders && request.Headers.TransferEncodingChunked.GetValueOrDefault())
563 {
564 if (request.Content == null)
565 {
567 }
568 request.Content.Headers.ContentLength = null;
569 }
570 else if (request.Content != null && !request.Content.Headers.ContentLength.HasValue)
571 {
572 request.Headers.TransferEncodingChunked = true;
573 }
574 if (request.Version.Minor == 0 && request.Version.Major == 1 && request.HasHeaders)
575 {
576 if (request.Headers.TransferEncodingChunked == true)
577 {
578 return new NotSupportedException(System.SR.net_http_unsupported_chunking);
579 }
580 if (request.Headers.ExpectContinue == true)
581 {
582 request.Headers.ExpectContinue = false;
583 }
584 }
585 Uri requestUri = request.RequestUri;
586 if ((object)requestUri == null || !requestUri.IsAbsoluteUri)
587 {
589 }
590 if (!HttpUtilities.IsSupportedScheme(requestUri.Scheme))
591 {
592 return new NotSupportedException(System.SR.Format(System.SR.net_http_unsupported_requesturi_scheme, requestUri.Scheme));
593 }
594 return null;
595 }
static string net_http_unsupported_version
Definition SR.cs:138
static string net_http_chunked_not_allowed_with_empty_content
Definition SR.cs:86
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string net_http_client_invalid_requesturi
Definition SR.cs:62
static string net_http_client_execution_error
Definition SR.cs:58
static string net_http_unsupported_chunking
Definition SR.cs:136
static string net_http_unsupported_requesturi_scheme
Definition SR.cs:64
Definition SR.cs:7

References System.SR.Format(), System.Net.Http.HttpUtilities.IsSupportedScheme(), System.SR.net_http_chunked_not_allowed_with_empty_content, System.SR.net_http_client_execution_error, System.SR.net_http_client_invalid_requesturi, System.SR.net_http_unsupported_chunking, System.SR.net_http_unsupported_requesturi_scheme, and System.SR.net_http_unsupported_version.

Referenced by System.Net.Http.SocketsHttpHandler.Send(), and System.Net.Http.SocketsHttpHandler.SendAsync().