mirror of
https://github.com/actions/runner.git
synced 2025-12-10 20:36:49 +00:00
* Revert "always use Fips Cryptography (#896)"3b34e203dc* Revert "Update ldd check with dotnet 5."4b6ded0a01* Revert "Update SDK to .NET 5 (#799)"fc3ca9bb92* Update dotnet-install scripts
32 lines
1013 B
C#
32 lines
1013 B
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Net.Http;
|
|
|
|
namespace GitHub.Services.Common.Diagnostics
|
|
{
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
internal static class HttpRequestMessageExtensions
|
|
{
|
|
public static VssHttpMethod GetHttpMethod(this HttpRequestMessage message)
|
|
{
|
|
String methodName = message.Method.Method;
|
|
VssHttpMethod httpMethod = VssHttpMethod.UNKNOWN;
|
|
if (!Enum.TryParse<VssHttpMethod>(methodName, true, out httpMethod))
|
|
{
|
|
httpMethod = VssHttpMethod.UNKNOWN;
|
|
}
|
|
return httpMethod;
|
|
}
|
|
|
|
public static VssTraceActivity GetActivity(this HttpRequestMessage message)
|
|
{
|
|
Object traceActivity;
|
|
if (!message.Properties.TryGetValue(VssTraceActivity.PropertyName, out traceActivity))
|
|
{
|
|
return VssTraceActivity.Empty;
|
|
}
|
|
return (VssTraceActivity)traceActivity;
|
|
}
|
|
}
|
|
}
|