// 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(); } }
/// <summary> /// Cancels a request to an Internet resource. /// </summary> public override void Abort() { if (_request != null) { _request.Abort(); } }
// Prevent IIS from injecting HTML error details into response bodies that are already in progress. internal void AbortIfHeaderSent() { if (_headersSent) { _httpRequest.Abort(); } }
// 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 } }
// // 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(); } }
public override void Abort() => request.Abort();