Exemplo n.º 1
0
        // Prevent IIS from injecting HTML error details into response bodies that are already in progress.
        internal void AbortIfHeaderSent()
        {
            // 4.6+, this is more reliable as it includes non-OWIN modules.
            if (CheckHeadersWritten != null)
            {
                try
                {
                    bool written = (bool)CheckHeadersWritten.Invoke(_httpResponse, null);
                    if (written)
                    {
                        _httpRequest.Abort();
                    }
                    return;
                }
                catch (TargetInvocationException)
                {
                    // InnerException: NotImplementedException
                }
            }

            if (_headersSent)
            {
                _httpRequest.Abort();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Cancels a request to an Internet resource.
 /// </summary>
 public override void Abort()
 {
     if (_request != null)
     {
         _request.Abort();
     }
 }
Exemplo n.º 3
0
 // Prevent IIS from injecting HTML error details into response bodies that are already in progress.
 internal void AbortIfHeaderSent()
 {
     if (_headersSent)
     {
         _httpRequest.Abort();
     }
 }
Exemplo n.º 4
0
        // Prevent IIS from injecting HTML error details into response bodies that are already in progress.
        internal void AbortIfHeaderSent()
        {
            if (_headersSent)
            {
#if !NET40
                _httpRequest.Abort();
#endif
            }
        }
Exemplo n.º 5
0
 //
 // Summary:
 //     Forcibly terminates the underlying TCP connection, causing any outstanding I/O
 //     to fail. You might use this method in response to an attack by a malicious HTTP
 //     client.
 public void Abort()
 {
     if (_httpRequest != null)
     {
         _httpRequest.Abort();
     }
     else
     {
         _httpRequestBase.Abort();
     }
 }
Exemplo n.º 6
0
 public override void Abort() => request.Abort();