< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.HttpRequestContext
Assembly: CoreWCF.Http
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Http/src/CoreWCF/Channels/HttpRequestContext.cs
Line coverage
72%
Covered lines: 161
Uncovered lines: 60
Coverable lines: 221
Total lines: 622
Line coverage: 72.8%
Branch coverage
68%
Covered branches: 68
Total branches: 100
Branch coverage: 68%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%11100%
GetHttpInput(...)37.5%8850%
CreateContext(...)100%11100%
GetHttpOutputCore(...)50%2266.66%
OnAbort()0%220%
OnCloseAsync()100%22100%
Cleanup()100%11100%
SetMessage(...)75%8872.72%
TraceHttpMessageReceived(...)100%11100%
PrepareReply(...)68.18%222285.71%
OnReplyAsync()83.33%6690%
ProcessAuthenticationAsync()20%101047.36%
SendResponseAndCloseAsync(...)100%11100%
SendResponseAndCloseAsync()100%22100%
CreateAckMessage(...)100%22100%
.ctor(...)100%11100%
GetHttpInput()100%11100%
GetHttpOutput(...)87.5%8887.5%
OnProcessAuthenticationAsync()100%22100%
ValidateAuthentication()75%44100%
OnAbort()100%110%
OnCloseAsync(...)100%11100%
CreateSecurityContextAsync()50%6643.75%
.ctor(...)100%11100%
CheckForContentAsync()100%44100%
AddProperties(...)83.33%66100%
GetInputStream()100%22100%
.ctor(...)100%11100%
.ctor(...)100%11100%
BeginRead(...)100%110%
EndRead(...)100%110%
Read(...)100%1140%
ReadByte()100%1140%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Http/src/CoreWCF/Channels/HttpRequestContext.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using System.Collections.ObjectModel;
 6using System.Diagnostics;
 7using System.IO;
 8using System.Net;
 9using System.Security.Authentication.ExtendedProtection;
 10using System.Security.Claims;
 11using System.Security.Principal;
 12using System.Threading;
 13using System.Threading.Tasks;
 14using System.Xml;
 15using CoreWCF.IdentityModel;
 16using CoreWCF.IdentityModel.Policy;
 17using CoreWCF.IdentityModel.Selectors;
 18using CoreWCF.IdentityModel.Tokens;
 19using CoreWCF.Runtime;
 20using CoreWCF.Security;
 21using Microsoft.AspNetCore.Authentication;
 22using Microsoft.AspNetCore.Http;
 23
 24namespace CoreWCF.Channels
 25{
 26    internal abstract class HttpRequestContext : RequestContextBase
 27    {
 28        private HttpOutput _httpOutput;
 29        private bool _errorGettingHttpInput;
 30        private SecurityMessageProperty _securityProperty;
 31        private readonly TaskCompletionSource<object> _replySentTcs;
 32        //EventTraceActivity eventTraceActivity;
 33        //ServerWebSocketTransportDuplexSessionChannel webSocketChannel;
 34
 35        protected HttpRequestContext(IHttpTransportFactorySettings settings, Message requestMessage)
 65036            : base(requestMessage, settings.CloseTimeout, settings.SendTimeout)
 37        {
 65038            HttpTransportSettings = settings;
 65039            _replySentTcs = new TaskCompletionSource<object>(TaskContinuationOptions.RunContinuationsAsynchronously);
 65040        }
 41
 42        public bool KeepAliveEnabled
 43        {
 44            get
 45            {
 046                return HttpTransportSettings.KeepAliveEnabled;
 47            }
 48        }
 49
 50        public abstract string HttpMethod { get; }
 51
 52        //internal ServerWebSocketTransportDuplexSessionChannel WebSocketChannel
 53        //{
 54        //    get
 55        //    {
 56        //        return this.webSocketChannel;
 57        //    }
 58
 59        //    set
 60        //    {
 61        //        Fx.Assert(this.webSocketChannel == null, "webSocketChannel should not be set twice.");
 62        //        this.webSocketChannel = value;
 63        //    }
 64        //}
 65
 455066        internal IHttpTransportFactorySettings HttpTransportSettings { get; }
 67
 68        //internal EventTraceActivity EventTraceActivity
 69        //{
 70        //    get
 71        //    {
 72        //        return this.eventTraceActivity;
 73        //    }
 74        //}
 75
 76        // Note: This method will return null in the case where throwOnError is false, and a non-fatal error occurs.
 77        // Please exercise caution when passing in throwOnError = false.  This should basically only be done in error
 78        // code paths, or code paths where there is very good reason that you would not want this method to throw.
 79        // When passing in throwOnError = false, please handle the case where this method returns null.
 80        public HttpInput GetHttpInput(bool throwOnError)
 81        {
 65082            HttpInput httpInput = null;
 65083            if (throwOnError || !_errorGettingHttpInput)
 84            {
 85                try
 86                {
 65087                    httpInput = GetHttpInput();
 65088                    _errorGettingHttpInput = false;
 65089                }
 090                catch (Exception e)
 91                {
 092                    _errorGettingHttpInput = true;
 093                    if (throwOnError || Fx.IsFatal(e))
 94                    {
 095                        throw;
 96                    }
 97
 098                    DiagnosticUtility.TraceHandledException(e, TraceEventType.Warning);
 099                }
 100            }
 101
 650102            return httpInput;
 103        }
 104
 105        internal static HttpRequestContext CreateContext(IHttpTransportFactorySettings settings, HttpContext httpContext
 106        {
 650107            return new AspNetCoreHttpContext(settings, httpContext);
 108        }
 109
 110        protected abstract Task<SecurityMessageProperty> OnProcessAuthenticationAsync();
 111
 112        public abstract HttpOutput GetHttpOutput(Message message);
 113
 114        protected abstract HttpInput GetHttpInput();
 115
 116        public HttpOutput GetHttpOutputCore(Message message)
 117        {
 650118            if (_httpOutput != null)
 119            {
 0120                return _httpOutput;
 121            }
 122
 650123            return GetHttpOutput(message);
 124        }
 125
 126        protected override void OnAbort()
 127        {
 0128            if (_httpOutput != null)
 129            {
 0130                _httpOutput.Abort(HttpAbortReason.Aborted);
 131            }
 132
 0133            Cleanup();
 0134            _replySentTcs.TrySetResult(null);
 0135        }
 136
 137        protected override async Task OnCloseAsync(CancellationToken token)
 138        {
 139            try
 140            {
 648141                if (_httpOutput != null)
 142                {
 648143                    await _httpOutput.CloseAsync(); ;
 144                }
 648145            }
 146            finally
 147            {
 648148                Cleanup();
 648149                _replySentTcs.TrySetResult(null);
 150            }
 648151        }
 152
 153        protected virtual void Cleanup()
 154        {
 648155        }
 156
 157        internal void SetMessage(Message message, Exception requestException)
 158        {
 648159            if ((message == null) && (requestException == null))
 160            {
 0161                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
 0162                    new ProtocolException(SR.MessageXmlProtocolError,
 0163                    new XmlException(SR.MessageIsEmpty)));
 164            }
 165
 648166            TraceHttpMessageReceived(message);
 167
 648168            if (requestException != null)
 169            {
 1170                SetRequestMessage(requestException);
 1171                message.Close();
 172            }
 173            else
 174            {
 647175                message.Properties.Security = (_securityProperty != null) ? (SecurityMessageProperty)_securityProperty.C
 647176                SetRequestMessage(message);
 177            }
 647178        }
 179
 180        private void TraceHttpMessageReceived(Message message)
 181        {
 648182        }
 183
 184        protected abstract HttpStatusCode ValidateAuthentication();
 185
 186        private bool PrepareReply(ref Message message)
 187        {
 650188            bool closeOnReceivedEof = false;
 189
 190            // null means we're done
 650191            if (message == null)
 192            {
 193                // A null message means either a one-way request or that the service operation returned null and
 194                // hence we can close the HttpOutput. By default we keep the HttpOutput open to allow the writing to the
 195                // even after the HttpInput EOF is received and the HttpOutput will be closed only on close of the HttpR
 106196                closeOnReceivedEof = true;
 106197                message = CreateAckMessage(HttpStatusCode.Accepted, string.Empty);
 198            }
 199
 650200            if (!HttpTransportSettings.ManualAddressing)
 201            {
 615202                if (message.Version.Addressing == AddressingVersion.WSAddressingAugust2004)
 203                {
 2204                    if (message.Headers.To == null ||
 2205                        (HttpTransportSettings.AnonymousUriPrefixMatcher as HttpAnonymousUriPrefixMatcher) == null ||
 2206                        !(HttpTransportSettings.AnonymousUriPrefixMatcher as HttpAnonymousUriPrefixMatcher).IsAnonymousU
 207                    {
 2208                        message.Headers.To = message.Version.Addressing.AnonymousUri;
 209                    }
 210                }
 613211                else if (message.Version.Addressing == AddressingVersion.WSAddressing10
 613212                    || message.Version.Addressing == AddressingVersion.None)
 213                {
 613214                    if (message.Headers.To != null &&
 613215                        (HttpTransportSettings.AnonymousUriPrefixMatcher as HttpAnonymousUriPrefixMatcher == null ||
 613216                        !(HttpTransportSettings.AnonymousUriPrefixMatcher as HttpAnonymousUriPrefixMatcher).IsAnonymousU
 217                    {
 0218                        message.Headers.To = null;
 219                    }
 220                }
 221                else
 222                {
 0223                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
 0224                        new ProtocolException(SR.Format(SR.AddressingVersionNotSupported, message.Version.Addressing)));
 225                }
 226            }
 227
 650228            message.Properties.AllowOutputBatching = false;
 650229            _httpOutput = GetHttpOutputCore(message);
 230
 650231            return closeOnReceivedEof;
 232        }
 233
 234        protected override async Task OnReplyAsync(Message message, CancellationToken token)
 235        {
 650236            Message responseMessage = message;
 237
 238            try
 239            {
 650240                bool closeOutputAfterReply = PrepareReply(ref responseMessage);
 650241                await _httpOutput.SendAsync(token);
 242
 650243                if (closeOutputAfterReply)
 244                {
 106245                    await _httpOutput.CloseAsync();
 246                }
 650247            }
 248            finally
 249            {
 650250                if (message != null &&
 650251                    !ReferenceEquals(message, responseMessage))
 252                {
 0253                    responseMessage.Close();
 254                }
 255            }
 650256        }
 257
 618258        public Task ReplySent => _replySentTcs.Task;
 259
 260        public async Task<bool> ProcessAuthenticationAsync()
 261        {
 650262            HttpStatusCode statusCode = ValidateAuthentication();
 263
 650264            if (statusCode == HttpStatusCode.OK)
 265            {
 650266                bool authenticationSucceeded = false;
 650267                statusCode = HttpStatusCode.Forbidden;
 268                try
 269                {
 650270                    _securityProperty = await OnProcessAuthenticationAsync();
 650271                    authenticationSucceeded = true;
 650272                    return true;
 273                }
 0274                catch (Exception e)
 275                {
 0276                    if (Fx.IsFatal(e))
 277                    {
 0278                        throw;
 279                    }
 280
 0281                    if (e.Data.Contains(HttpChannelUtilities.HttpStatusCodeKey))
 282                    {
 0283                        if (e.Data[HttpChannelUtilities.HttpStatusCodeKey] is HttpStatusCode)
 284                        {
 0285                            statusCode = (HttpStatusCode)e.Data[HttpChannelUtilities.HttpStatusCodeKey];
 286                        }
 287                    }
 288
 0289                    throw;
 290                }
 291                finally
 292                {
 650293                    if (!authenticationSucceeded)
 294                    {
 0295                        await SendResponseAndCloseAsync(statusCode);
 296                    }
 297                }
 298            }
 299            else
 300            {
 0301                await SendResponseAndCloseAsync(statusCode);
 0302                return false;
 303            }
 650304        }
 305
 306        internal Task SendResponseAndCloseAsync(HttpStatusCode statusCode)
 307        {
 31308            return SendResponseAndCloseAsync(statusCode, string.Empty);
 309        }
 310
 311        internal async Task SendResponseAndCloseAsync(HttpStatusCode statusCode, string statusDescription)
 312        {
 32313            if (ReplyInitiated)
 314            {
 30315                await CloseAsync();
 30316                return;
 317            }
 318
 2319            using (Message ackMessage = CreateAckMessage(statusCode, statusDescription))
 320            {
 2321                await ReplyAsync(ackMessage);
 2322            }
 323
 2324            await CloseAsync();
 32325        }
 326
 327        private Message CreateAckMessage(HttpStatusCode statusCode, string statusDescription)
 328        {
 108329            Message ackMessage = new NullMessage();
 108330            HttpResponseMessageProperty httpResponseProperty = new HttpResponseMessageProperty
 108331            {
 108332                StatusCode = statusCode,
 108333                SuppressEntityBody = true
 108334            };
 108335            if (statusDescription.Length > 0)
 336            {
 1337                httpResponseProperty.StatusDescription = statusDescription;
 338            }
 339
 108340            ackMessage.Properties.Add(HttpResponseMessageProperty.Name, httpResponseProperty);
 341
 108342            return ackMessage;
 343        }
 344
 345        private class AspNetCoreHttpContext : HttpRequestContext
 346        {
 347            private const string Http11ProtocolString = "HTTP/1.1";
 348            private readonly HttpContext _aspNetContext;
 349            // byte[] webSocketInternalBuffer;
 350
 351            public AspNetCoreHttpContext(IHttpTransportFactorySettings settings, HttpContext aspNetContext)
 650352                : base(settings, null)
 353            {
 650354                _aspNetContext = aspNetContext;
 650355            }
 356
 650357            public override string HttpMethod => _aspNetContext.Request.Method;
 358
 359            protected override HttpInput GetHttpInput()
 360            {
 650361                return new AspNetCoreHttpInput(this);
 362            }
 363
 364            public override HttpOutput GetHttpOutput(Message message)
 365            {
 650366                if (StringComparer.OrdinalIgnoreCase.Equals(Http11ProtocolString, _aspNetContext.Request.Protocol))
 367                {
 650368                    if (HttpTransportSettings.KeepAliveEnabled)
 369                    {
 650370                        _aspNetContext.Response.Headers["Connection"] = "keep-alive";
 371                    }
 372                    else
 373                    {
 0374                        _aspNetContext.Response.Headers["Connection"] = "close";
 375                    }
 376                }
 377
 650378                if (HttpTransportSettings.MessageEncoderFactory.Encoder is ICompressedMessageEncoder compressedMessageEn
 379                {
 2380                    string acceptEncoding = _aspNetContext.Request.Headers[HttpChannelUtilities.AcceptEncodingHeader];
 2381                    compressedMessageEncoder.AddCompressedMessageProperties(message, acceptEncoding);
 382                }
 383
 650384                return HttpOutput.CreateHttpOutput(_aspNetContext, HttpTransportSettings, message, HttpMethod);
 385            }
 386
 387            protected override async Task<SecurityMessageProperty> OnProcessAuthenticationAsync()
 388            {
 650389                if (HttpTransportSettings.IsAuthenticationRequired)
 390                {
 56391                    ServiceSecurityContext securityContext = await CreateSecurityContextAsync(_aspNetContext.User);
 56392                    SecurityMessageProperty securityMessageProperty = new()
 56393                    {
 56394                        ServiceSecurityContext = securityContext
 56395                    };
 56396                    return securityMessageProperty;
 397                }
 398
 594399                return null;
 650400            }
 401
 402            protected override HttpStatusCode ValidateAuthentication()
 403            {
 650404                if (HttpTransportSettings.IsAuthenticationRequired)
 405                {
 56406                    return _aspNetContext.User.Identity.IsAuthenticated
 56407                        ? HttpStatusCode.OK
 56408                        : HttpStatusCode.Unauthorized;
 409                }
 410
 594411                return HttpStatusCode.OK;
 412                //return Listener.ValidateAuthentication(listenerContext);
 413            }
 414
 415            protected override void OnAbort()
 416            {
 0417                _aspNetContext.Abort();
 0418                Cleanup();
 0419            }
 420
 421            protected override Task OnCloseAsync(CancellationToken token)
 422            {
 648423                return base.OnCloseAsync(token);
 424                //try
 425                //{
 426                //    // TODO: Work out how to close the HttpContext
 427                //    // Most likely will be some mechanism to complete the Task returned by the RequestDelegate
 428                //    aspNetContext.Response.Close();
 429                //}
 430                //catch (HttpListenerException listenerException)
 431                //{
 432                //    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
 433                //        HttpChannelUtilities.CreateCommunicationException(listenerException));
 434                //}
 435            }
 436
 437            private async Task<ServiceSecurityContext> CreateSecurityContextAsync(IPrincipal principal)
 438            {
 56439                if (principal.Identity is WindowsIdentity wid)
 440                {
 0441                    WindowsSecurityTokenAuthenticator tokenAuthenticator = new WindowsSecurityTokenAuthenticator();
 0442                    SecurityToken windowsToken = new WindowsSecurityToken(wid);
 0443                    ReadOnlyCollection<IAuthorizationPolicy> authorizationPolicies = await tokenAuthenticator.ValidateTo
 0444                    return new ServiceSecurityContext(authorizationPolicies);
 445                }
 56446                else if (principal.Identity is GenericIdentity gid)
 447                {
 0448                    WindowsSecurityTokenAuthenticator tokenAuthenticator = new WindowsSecurityTokenAuthenticator();
 0449                    SecurityToken genericToken = new GenericIdentitySecurityToken(gid, SecurityUniqueId.Create().Value);
 0450                    ReadOnlyCollection<IAuthorizationPolicy> authorizationPolicies = await tokenAuthenticator.ValidateTo
 0451                    return new ServiceSecurityContext(authorizationPolicies);
 452                }
 56453                else if (principal.Identity is ClaimsIdentity)
 454                {
 56455                    AuthorizationContext authorizationContext = AuthorizationContext.CreateDefaultAuthorizationContext(n
 56456                    authorizationContext.Properties.Add(nameof(ClaimsPrincipal), principal);
 56457                    return new ServiceSecurityContext(authorizationContext);
 458                }
 459
 0460                return null;
 56461            }
 462
 463            private class AspNetCoreHttpInput : HttpInput
 464            {
 465                private readonly AspNetCoreHttpContext _aspNetCoreHttpContext;
 466                private string _cachedContentType; // accessing the header in System.Net involves a native transition
 467                private byte[] _preReadBuffer;
 468
 469                // TODO: ChannelBindingSupport
 470                public AspNetCoreHttpInput(AspNetCoreHttpContext aspNetCoreHttpContext)
 650471                    : base(aspNetCoreHttpContext.HttpTransportSettings, true, false /* ChannelBindingSupportEnabled */)
 472                {
 650473                    _aspNetCoreHttpContext = aspNetCoreHttpContext;
 650474                }
 475
 476                protected override async Task CheckForContentAsync()
 477                {
 650478                    if (!_aspNetCoreHttpContext._aspNetContext.Request.ContentLength.HasValue)
 479                    {
 44480                        _preReadBuffer = new byte[1];
 481                        // TODO: Look into useing PipeReader with look-ahead
 44482                        if (await _aspNetCoreHttpContext._aspNetContext.Request.Body.ReadAsync(_preReadBuffer, 0, 1) == 
 483                        {
 28484                            _preReadBuffer = null;
 485                        }
 486                    }
 650487                }
 488
 489                // TODO: Switch to nullable
 3082490                public override long ContentLength => _aspNetCoreHttpContext._aspNetContext.Request.ContentLength ?? -1;
 491
 492                protected override string ContentTypeCore
 493                {
 494                    get
 495                    {
 2107496                        if (_cachedContentType == null)
 497                        {
 624498                            _cachedContentType = _aspNetCoreHttpContext._aspNetContext.Request.ContentType;
 499                        }
 500
 2107501                        return _cachedContentType;
 502                    }
 503                }
 504
 1299505                protected override bool HasContent => _preReadBuffer != null || ContentLength > 0;
 506
 493507                protected override string SoapActionHeader => _aspNetCoreHttpContext._aspNetContext.Request.Headers["SOA
 508
 509
 510                protected override ChannelBinding ChannelBinding
 511                {
 512                    get
 513                    {
 0514                        throw new PlatformNotSupportedException("Shouldn't be able to request CBT"); // TODO: ChannelBin
 515                        // return ChannelBindingUtility.GetToken(this.listenerHttpContext.listenerContext.Request.Transp
 516                    }
 517                }
 518
 519                protected override void AddProperties(Message message)
 520                {
 648521                    HttpRequest request = _aspNetCoreHttpContext._aspNetContext.Request;
 648522                    var requestProperty = new HttpRequestMessageProperty(_aspNetCoreHttpContext._aspNetContext);
 648523                    message.Properties.Add(HttpRequestMessageProperty.Name, requestProperty);
 648524                    String hostAddress = String.Concat(request.IsHttps ? "https://" : "http://", request.Host.HasValue ?
 525                    // TODO: Test the Via code
 648526                    message.Properties.Via = new Uri(string.Concat(
 648527                        hostAddress,
 648528                        request.PathBase.ToUriComponent(),
 648529                        request.Path.ToUriComponent(),
 648530                        request.QueryString.ToUriComponent()));
 531
 648532                    IPAddress remoteIPAddress = request.HttpContext.Connection.RemoteIpAddress;
 648533                    int remotePort = request.HttpContext.Connection.RemotePort;
 648534                    remotePort &= 0x0FFFF; // Ensure port is a valid 16-bit value. Work around for dotnet/aspnetcore#621
 535
 648536                    if (remoteIPAddress != null)
 537                    {
 616538                        RemoteEndpointMessageProperty remoteEndpointProperty = new RemoteEndpointMessageProperty(new IPE
 616539                        message.Properties.Add(RemoteEndpointMessageProperty.Name, remoteEndpointProperty);
 540                    }
 648541                }
 542
 543                protected override Stream GetInputStream()
 544                {
 621545                    if (_preReadBuffer != null)
 546                    {
 16547                        return new AspNetCoreInputStream(_aspNetCoreHttpContext, _preReadBuffer);
 548                    }
 549                    else
 550                    {
 605551                        return new AspNetCoreInputStream(_aspNetCoreHttpContext);
 552                    }
 553                }
 554
 555                private class AspNetCoreInputStream : DetectEofStream
 556                {
 557                    public AspNetCoreInputStream(AspNetCoreHttpContext aspNetCoreHttpContext)
 605558                        : base(aspNetCoreHttpContext._aspNetContext.Request.Body)
 559                    {
 605560                    }
 561
 562                    public AspNetCoreInputStream(AspNetCoreHttpContext aspNetCoreHttpContext, byte[] preReadBuffer)
 16563                        : base(new PreReadStream(aspNetCoreHttpContext._aspNetContext.Request.Body, preReadBuffer))
 564                    {
 16565                    }
 566
 567                    public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback,
 568                    {
 569                        try
 570                        {
 0571                            return base.BeginRead(buffer, offset, count, callback, state);
 572                        }
 0573                        catch (Exception exception)
 574                        {
 0575                            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
 0576                                HttpChannelUtilities.CreateCommunicationException(exception));
 577                        }
 0578                    }
 579
 580                    public override int EndRead(IAsyncResult result)
 581                    {
 582                        try
 583                        {
 0584                            return base.EndRead(result);
 585                        }
 0586                        catch (Exception exception)
 587                        {
 0588                            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
 0589                                HttpChannelUtilities.CreateCommunicationException(exception));
 590                        }
 0591                    }
 592
 593                    public override int Read(byte[] buffer, int offset, int count)
 594                    {
 595                        try
 596                        {
 11513597                            return base.Read(buffer, offset, count);
 598                        }
 0599                        catch (Exception exception)
 600                        {
 0601                            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
 0602                                HttpChannelUtilities.CreateCommunicationException(exception));
 603                        }
 11513604                    }
 605
 606                    public override int ReadByte()
 607                    {
 608                        try
 609                        {
 11406610                            return base.ReadByte();
 611                        }
 0612                        catch (Exception exception)
 613                        {
 0614                            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
 0615                                HttpChannelUtilities.CreateCommunicationException(exception));
 616                        }
 11406617                    }
 618                }
 619            }
 620        }
 621    }
 622}

Methods/Properties

.ctor(CoreWCF.Channels.IHttpTransportFactorySettings,CoreWCF.Channels.Message)
KeepAliveEnabled()
HttpTransportSettings()
GetHttpInput(System.Boolean)
CreateContext(CoreWCF.Channels.IHttpTransportFactorySettings,Microsoft.AspNetCore.Http.HttpContext)
GetHttpOutputCore(CoreWCF.Channels.Message)
OnAbort()
OnCloseAsync()
Cleanup()
SetMessage(CoreWCF.Channels.Message,System.Exception)
TraceHttpMessageReceived(CoreWCF.Channels.Message)
PrepareReply(CoreWCF.Channels.Message&)
OnReplyAsync()
ReplySent()
ProcessAuthenticationAsync()
SendResponseAndCloseAsync(System.Net.HttpStatusCode)
SendResponseAndCloseAsync()
CreateAckMessage(System.Net.HttpStatusCode,System.String)
.ctor(CoreWCF.Channels.IHttpTransportFactorySettings,Microsoft.AspNetCore.Http.HttpContext)
HttpMethod()
GetHttpInput()
GetHttpOutput(CoreWCF.Channels.Message)
OnProcessAuthenticationAsync()
ValidateAuthentication()
OnAbort()
OnCloseAsync(System.Threading.CancellationToken)
CreateSecurityContextAsync()
.ctor(CoreWCF.Channels.HttpRequestContext/AspNetCoreHttpContext)
CheckForContentAsync()
ContentLength()
ContentTypeCore()
HasContent()
SoapActionHeader()
ChannelBinding()
AddProperties(CoreWCF.Channels.Message)
GetInputStream()
.ctor(CoreWCF.Channels.HttpRequestContext/AspNetCoreHttpContext)
.ctor(CoreWCF.Channels.HttpRequestContext/AspNetCoreHttpContext,System.Byte[])
BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)
EndRead(System.IAsyncResult)
Read(System.Byte[],System.Int32,System.Int32)
ReadByte()