Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

Commit

Permalink
#102 Filter out DEBUG requests under the debugger.
Browse files Browse the repository at this point in the history
Tratcher committed May 25, 2016

Verified

This commit was signed with the committer’s verified signature.
richiware Ricardo González
1 parent 4f7e4cf commit ed85f50
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Diagnostics;
using System.Globalization;
using System.Security.Principal;
using System.Threading.Tasks;
@@ -61,6 +62,13 @@ public async Task Invoke(HttpContext httpContext)
return;
}

if (Debugger.IsAttached && string.Equals("DEBUG", httpContext.Request.Method, StringComparison.OrdinalIgnoreCase))

This comment has been minimized.

Copy link
@davidfowl

davidfowl May 26, 2016

Member

We decided to do it here instead of ANCM? Why is that?

This comment has been minimized.

Copy link
@Tratcher

Tratcher May 26, 2016

Author Member

A) The debugger attaches to the app process before attaching to IIS Express (or else some of the profiling tools won't work), so there's a race detecting Debugger.IsAttached in ANCM.
B) This is a temporary mitigation and we have plans to replace it.

This comment has been minimized.

Copy link
@davidfowl

davidfowl May 29, 2016

Member

Kewl. I saw the autostart plans. LGTM

{
// The Visual Studio debugger tooling sends a DEBUG request to make IIS & AspNetCoreModule launch the process
// so the debugger can attach. Filter out this request from the app.
return;
}

if (_options.ForwardClientCertificate)
{
var header = httpContext.Request.Headers[MSAspNetCoreClientCert];

0 comments on commit ed85f50

Please sign in to comment.