Skip to content

Commit

Permalink
WebRequest and HttpMessageHandler type arrays (DataDog#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-higgins authored Jun 13, 2019
1 parent a435767 commit a8ecc8e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
16 changes: 8 additions & 8 deletions integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,9 @@
"type": "System.Net.Http.HttpMessageHandler",
"method": "SendAsync",
"signature_types": [
"_",
"_",
"_"
"System.Threading.Tasks.Task`1<System.Net.Http.HttpResponseMessage>",
"System.Net.Http.HttpRequestMessage",
"System.Threading.CancellationToken"
],
"minimum_major": 4,
"minimum_minor": 0,
Expand All @@ -432,9 +432,9 @@
"type": "System.Net.Http.HttpClientHandler",
"method": "SendAsync",
"signature_types": [
"_",
"_",
"_"
"System.Threading.Tasks.Task`1<System.Net.Http.HttpResponseMessage>",
"System.Net.Http.HttpRequestMessage",
"System.Threading.CancellationToken"
],
"minimum_major": 4,
"minimum_minor": 0,
Expand Down Expand Up @@ -806,7 +806,7 @@
"type": "System.Net.WebRequest",
"method": "GetResponse",
"signature_types": [
"_"
"System.Net.WebResponse"
],
"minimum_major": 4,
"minimum_minor": 0,
Expand All @@ -829,7 +829,7 @@
"type": "System.Net.WebRequest",
"method": "GetResponse",
"signature_types": [
"_"
"System.Net.WebResponse"
],
"minimum_major": 4,
"minimum_minor": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace Datadog.Trace.ClrProfiler.Integrations
public static class HttpMessageHandlerIntegration
{
private const string IntegrationName = "HttpMessageHandler";
private const string SystemNetHttp = "System.Net.Http";
private const string Major4 = "4";

/// <summary>
Expand All @@ -25,10 +26,10 @@ public static class HttpMessageHandlerIntegration
/// <param name="opCode">The OpCode used in the original method call.</param>
/// <returns>Returns the value returned by the inner method call.</returns>
[InterceptMethod(
TargetAssembly = "System.Net.Http",
TargetAssembly = SystemNetHttp,
TargetType = "System.Net.Http.HttpMessageHandler",
TargetMethod = "SendAsync",
TargetSignatureTypes = new[] { ClrNames.Ignore, ClrNames.Ignore, ClrNames.Ignore },
TargetSignatureTypes = new[] { "System.Threading.Tasks.Task`1<System.Net.Http.HttpResponseMessage>", "System.Net.Http.HttpRequestMessage", ClrNames.CancellationToken },
TargetMinimumVersion = Major4,
TargetMaximumVersion = Major4)]
public static object HttpMessageHandler_SendAsync(
Expand Down Expand Up @@ -67,10 +68,10 @@ public static object HttpMessageHandler_SendAsync(
/// <param name="opCode">The OpCode used in the original method call.</param>
/// <returns>Returns the value returned by the inner method call.</returns>
[InterceptMethod(
TargetAssembly = "System.Net.Http",
TargetAssembly = SystemNetHttp,
TargetType = "System.Net.Http.HttpClientHandler",
TargetMethod = "SendAsync",
TargetSignatureTypes = new[] { ClrNames.Ignore, ClrNames.Ignore, ClrNames.Ignore },
TargetSignatureTypes = new[] { "System.Threading.Tasks.Task`1<System.Net.Http.HttpResponseMessage>", "System.Net.Http.HttpRequestMessage", ClrNames.CancellationToken },
TargetMinimumVersion = Major4,
TargetMaximumVersion = Major4)]
public static object HttpClientHandler_SendAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ public static class WebRequestIntegration
[InterceptMethod(
TargetAssembly = "System", // .NET Framework
TargetType = "System.Net.WebRequest",
TargetSignatureTypes = new[] { ClrNames.Ignore },
TargetSignatureTypes = new[] { "System.Net.WebResponse" },
TargetMinimumVersion = Major4,
TargetMaximumVersion = Major4)]
[InterceptMethod(
TargetAssembly = "System.Net.Requests", // .NET Core
TargetType = "System.Net.WebRequest",
TargetSignatureTypes = new[] { ClrNames.Ignore },
TargetSignatureTypes = new[] { "System.Net.WebResponse" },
TargetMinimumVersion = Major4,
TargetMaximumVersion = Major4)]
public static object GetResponse(object webRequest, int opCode)
Expand Down

0 comments on commit a8ecc8e

Please sign in to comment.